Linux Security Modules development
 help / color / mirror / Atom feed
* [PATCH] lockdown: remove useless decrement operation
@ 2026-05-01 17:44 Kalevi Kolttonen
  2026-05-05  9:20 ` Nicolas Bouchinet
  2026-05-05  9:51 ` Nicolas Bouchinet
  0 siblings, 2 replies; 4+ messages in thread
From: Kalevi Kolttonen @ 2026-05-01 17:44 UTC (permalink / raw)
  To: linux-security-module; +Cc: Kalevi Kolttonen

Signed-off-by: Kalevi Kolttonen <kalevi@kolttonen.fi>
---
 security/lockdown/lockdown.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
index 8d46886d2cca..2659d36bb74c 100644
--- a/security/lockdown/lockdown.c
+++ b/security/lockdown/lockdown.c
@@ -130,10 +130,8 @@ static ssize_t lockdown_write(struct file *file, const char __user *buf,
 		return PTR_ERR(state);
 
 	len = strlen(state);
-	if (len && state[len-1] == '\n') {
+	if (len && state[len-1] == '\n')
 		state[len-1] = '\0';
-		len--;
-	}
 
 	for (i = 0; i < ARRAY_SIZE(lockdown_levels); i++) {
 		enum lockdown_reason level = lockdown_levels[i];
-- 
2.54.0


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

end of thread, other threads:[~2026-05-07  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-01 17:44 [PATCH] lockdown: remove useless decrement operation Kalevi Kolttonen
2026-05-05  9:20 ` Nicolas Bouchinet
2026-05-05  9:51 ` Nicolas Bouchinet
2026-05-07  9:38   ` Xiu Jianfeng

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