Skip to contentSkip to conversation

lsm: remove redundant NULL check in security_init()

PATCH Applied Sang-Heon Jeon 3 participants 3 messages Sep 28 – Sep 30 Security (LSM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lsm: remove redundant NULL check in security_init()

Since commit 5137e583ba26 ("lsm: cleanup the debug and console output in lsm_init.c"), the NULL check for lsm_order_legacy in security_init() has no effect.

So remove the check.

No functional change.

---
 security/lsm_init.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
security/lsm_init.c +1 -2
index dbda7771013b..8d5ecea99c46 100644
@@ -431,8 +431,7 @@ int __init security_init(void)
 	}
 
 	if (lsm_order_cmdline) {
-		if (lsm_order_legacy)
-			lsm_order_legacy = NULL;
+		lsm_order_legacy = NULL;
 		lsm_order_parse(lsm_order_cmdline, "cmdline");
 	} else
 		lsm_order_parse(lsm_order_builtin, "builtin");

base-commit: 63b4c8561b436e8950409d6041fce43f12936f59

Signature · 1 line
2.43.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines

Since commit 5137e583ba26 ("lsm: cleanup the debug and console output in lsm_init.c"), the NULL check for lsm_order_legacy in security_init() has no effect.

So remove the check.

No functional change.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Applied
#2 lore raw
In reply to Sang-Heon Jeon
Quoted 5 lines · On Sep 28, 2026 Sang-Heon Jeon <[email protected]> wrote:

Since commit 5137e583ba26 ("lsm: cleanup the debug and console output in lsm_init.c"), the NULL check for lsm_order_legacy in security_init() has no effect.

Quoted 8 lines

So remove the check.

No functional change.

---
 security/lsm_init.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Merged into lsm/dev, thanks.

--
paul-moore.com