From: Shachar Sharon Date: Mon, 6 Jul 2026 13:11:45 +0000 (+0300) Subject: profile: avoid duplicate logic in get/lookup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56176fb6cc3135d90158593ed380c1cdf0d1ef90;p=thirdparty%2Fsamba.git profile: avoid duplicate logic in get/lookup 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 Reviewed-by: Vinit Agnihotri Reviewed-by: Anoop C S Reviewed-by: Jennifer Sutton --- diff --git a/source3/profile/profile.c b/source3/profile/profile.c index 12a9aef0bec..9eb793c81d6 100644 --- a/source3/profile/profile.c +++ b/source3/profile/profile.c @@ -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;