mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] apparmor: Remove the unused variable rules
@ 2025-07-25  9:52 Jiapeng Chong
  2025-07-30  9:55 ` John Johansen
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2025-07-25  9:52 UTC (permalink / raw)
  To: john.johansen
  Cc: paul, jmorris, serge, apparmor, linux-security-module,
	linux-kernel, Jiapeng Chong, Abaci Robot

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>
---
 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);
-- 
2.43.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] apparmor: Remove the unused variable rules
  2025-07-25  9:52 [PATCH -next] apparmor: Remove the unused variable rules Jiapeng Chong
@ 2025-07-30  9:55 ` John Johansen
  0 siblings, 0 replies; 2+ messages in thread
From: John Johansen @ 2025-07-30  9:55 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: paul, jmorris, serge, apparmor, linux-security-module,
	linux-kernel, Abaci Robot

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@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=22942
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Acked-by: John Johansen <john.johansen@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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-30 10:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-25  9:52 [PATCH -next] apparmor: Remove the unused variable rules Jiapeng Chong
2025-07-30  9:55 ` John Johansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®