linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] apparmor: Remove unused value
@ 2025-08-14 16:54 Chandra Mohan Sundar
  2025-08-15  4:10 ` Akhilesh Patil
  0 siblings, 1 reply; 3+ messages in thread
From: Chandra Mohan Sundar @ 2025-08-14 16:54 UTC (permalink / raw)
  To: john.johansen, paul, jmorris, serge, apparmor,
	linux-security-module, linux-kernel, shuah
  Cc: Chandra Mohan Sundar, linux-kernel-mentees

The value "new" is being assigned to NULL but that statement does not
have effect since "new" is being overwritten in the subsequent
fallback case.

Remove the unused value. This issue was reported by coverity static
analyzer.

Fixes: a9eb185be84e9 ("apparmor: fix x_table_lookup when stacking is not the first entry")
Signed-off-by: Chandra Mohan Sundar <chandramohan.explore@gmail.com>
---
Changes since v1:
    Fixed the commit message and Fixes tag message formatting.

 security/apparmor/domain.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
index 267da82afb14..9c0c7fa8de46 100644
--- a/security/apparmor/domain.c
+++ b/security/apparmor/domain.c
@@ -592,7 +592,6 @@ static struct aa_label *x_to_label(struct aa_profile *profile,
 		if (!new || **lookupname != '&')
 			break;
 		stack = new;
-		new = NULL;
 		fallthrough;	/* to X_NAME */
 	case AA_X_NAME:
 		if (xindex & AA_X_CHILD)
-- 
2.43.0


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

* Re: [PATCH v2] apparmor: Remove unused value
  2025-08-14 16:54 [PATCH v2] apparmor: Remove unused value Chandra Mohan Sundar
@ 2025-08-15  4:10 ` Akhilesh Patil
  2025-08-15  6:34   ` Chandra Mohan Sundar
  0 siblings, 1 reply; 3+ messages in thread
From: Akhilesh Patil @ 2025-08-15  4:10 UTC (permalink / raw)
  To: Chandra Mohan Sundar
  Cc: john.johansen, paul, jmorris, serge, apparmor,
	linux-security-module, linux-kernel, shuah, linux-kernel-mentees

On Thu, Aug 14, 2025 at 10:24:01PM +0530, Chandra Mohan Sundar wrote:
> The value "new" is being assigned to NULL but that statement does not
> have effect since "new" is being overwritten in the subsequent
> fallback case.
> 
> Remove the unused value. This issue was reported by coverity static
> analyzer.

Hi Chandra. Do you have Coverity ID for this issue ?

Regards,
Akhilesh
> 
> Fixes: a9eb185be84e9 ("apparmor: fix x_table_lookup when stacking is not the first entry")
> Signed-off-by: Chandra Mohan Sundar <chandramohan.explore@gmail.com>
> ---
> Changes since v1:
>     Fixed the commit message and Fixes tag message formatting.
> 
>  security/apparmor/domain.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 267da82afb14..9c0c7fa8de46 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -592,7 +592,6 @@ static struct aa_label *x_to_label(struct aa_profile *profile,
>  		if (!new || **lookupname != '&')
>  			break;
>  		stack = new;
> -		new = NULL;
>  		fallthrough;	/* to X_NAME */
>  	case AA_X_NAME:
>  		if (xindex & AA_X_CHILD)
> -- 
> 2.43.0
> 
> 

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

* Re: [PATCH v2] apparmor: Remove unused value
  2025-08-15  4:10 ` Akhilesh Patil
@ 2025-08-15  6:34   ` Chandra Mohan Sundar
  0 siblings, 0 replies; 3+ messages in thread
From: Chandra Mohan Sundar @ 2025-08-15  6:34 UTC (permalink / raw)
  To: Akhilesh Patil
  Cc: john.johansen, paul, jmorris, serge, apparmor,
	linux-security-module, linux-kernel, shuah, linux-kernel-mentees

On Fri, Aug 15, 2025 at 9:40 AM Akhilesh Patil <akhilesh@ee.iitb.ac.in> wrote:
>
> On Thu, Aug 14, 2025 at 10:24:01PM +0530, Chandra Mohan Sundar wrote:
> > The value "new" is being assigned to NULL but that statement does not
> > have effect since "new" is being overwritten in the subsequent
> > fallback case.
> >
> > Remove the unused value. This issue was reported by coverity static
> > analyzer.
>
> Hi Chandra. Do you have Coverity ID for this issue ?
>
Hi Akhilesh,

Sure. The Coverity id is 1662453 (
https://scan5.scan.coverity.com/#/project-view/65357/10063?selectedIssue=1662453
).

Thanks,
Chandra Mohan Sundar

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

end of thread, other threads:[~2025-08-15  6:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14 16:54 [PATCH v2] apparmor: Remove unused value Chandra Mohan Sundar
2025-08-15  4:10 ` Akhilesh Patil
2025-08-15  6:34   ` Chandra Mohan Sundar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).