[PATCH -next] apparmor: Remove the unused variable rules
John Johansen
john.johansen at canonical.com
Wed Jul 30 09:55:16 UTC 2025
On 7/25/25 02:52, Jiapeng Chong wrote:
> 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 at linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=22942
> Signed-off-by: Jiapeng Chong <jiapeng.chong at linux.alibaba.com>
Acked-by: John Johansen <john.johansen at canonical.com>
I have pulled this in
> ---
> security/apparmor/lsm.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> index 5b1b5ac831e8..182a0e55802e 100644
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -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);
More information about the Linux-security-module-archive
mailing list