[PATCH -next -v2 2/8] lockdown: remove useless decrement operation
Xiu Jianfeng
xiujianfeng at huawei.com
Wed Nov 25 08:49:19 UTC 2026
On 11/10/2026 9:28 PM, Cai Xinchen wrote:
> From: Kalevi Kolttonen <kalevi at kolttonen.fi>
>
> Signed-off-by: Kalevi Kolttonen <kalevi at kolttonen.fi>
Nit: checkpatch.pl warns on this patch, it's better to have a commit
description.
> ---
> 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 263dcc80d839..8648508d49b2 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];
More information about the Linux-security-module-archive
mailing list