]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
apparmor: Remove the unused variable rules
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Fri, 25 Jul 2025 09:52:52 +0000 (17:52 +0800)
committerJohn Johansen <john.johansen@canonical.com>
Wed, 30 Jul 2025 11:57:56 +0000 (04:57 -0700)
Variable rules is not effectively used, so delete it.

security/apparmor/lsm.c:182:23: warning: variable ‘rules’ set but not used.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=22942
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/lsm.c

index cecbb985928f81cc4c3ce45fff71cdba314b77e4..9a64b2db02672985e18199646c62a503569b17ef 100644 (file)
@@ -179,10 +179,8 @@ static int apparmor_capget(const struct task_struct *target, kernel_cap_t *effec
                struct label_it i;
 
                label_for_each_confined(i, label, profile) {
-                       struct aa_ruleset *rules;
                        kernel_cap_t allowed;
 
-                       rules = profile->label.rules[0];
                        allowed = aa_profile_capget(profile);
                        *effective = cap_intersect(*effective, allowed);
                        *permitted = cap_intersect(*permitted, allowed);