Skip to contentSkip to conversation

apparmor: Remove unused value

PATCH In review Chandra Mohan Sundar 2 participants 3 messages Aug 14, 2025 – Aug 15, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 apparmor: Remove unused value

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")

---
Changes since v1:
Fixed the commit message and Fixes tag message formatting.

 security/apparmor/domain.c | 1 -
 1 file changed, 1 deletion(-)
security/apparmor/domain.c +0 -1
index 267da82afb14..9c0c7fa8de46 100644
@@ -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)
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Chandra Mohan Sundar

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

Quoted 26 lines
Fixes a9eb185be84e9 ("apparmor: fix x_table_lookup when stacking is not the first entry")

---
Changes since v1:
Fixed the commit message and Fixes tag message formatting.

 security/apparmor/domain.c | 1 -
 1 file changed, 1 deletion(-)
security/apparmor/domain.c +0 -1
index 267da82afb14..9c0c7fa8de46 100644
@@ -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)
Signature · 1 line
2.43.0
#2 lore raw
Quoted 11 lines · Akhilesh Patil
Quoted 6 lines · Chandra Mohan Sundar

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