]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
profile: avoid duplicate logic in get/lookup
authorShachar Sharon <ssharon@redhat.com>
Mon, 6 Jul 2026 13:11:45 +0000 (16:11 +0300)
committerAnoop C S <anoopcs@samba.org>
Thu, 9 Jul 2026 05:57:37 +0000 (05:57 +0000)
Do not duplicate the 'smbprofile_active()' and 'snum < 0' logic in two
places; use it only in lookup local helper.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
source3/profile/profile.c

index 12a9aef0bec5b8241f5197ba6128a328aef3fd0f..9eb793c81d6766b7e188433d5aad3ec3e5612b84 100644 (file)
@@ -486,10 +486,6 @@ struct profile_stats *smbprofile_persvc_get(int snum)
 {
        struct profile_stats_persvc *persvc = NULL;
 
-       if (!smbprofile_active() || (snum < 0)) {
-               return NULL;
-       }
-
        persvc = smbprofile_persvc_lookup(snum);
        if (persvc == NULL) {
                return NULL;