From 58b46219bfcf1906b795307372b0d50d65115026 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Sat, 11 Oct 2025 16:48:24 +0200 Subject: keys: Remove redundant less-than-zero checks The local variables 'size_t datalen' are unsigned and cannot be less than zero. Remove the redundant conditions. Signed-off-by: Thorsten Blum Reviewed-by: Mimi Zohar Signed-off-by: Jarkko Sakkinen --- security/keys/user_defined.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'security/keys/user_defined.c') diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c index 749e2a4dcb13..686d56e4cc85 100644 --- a/security/keys/user_defined.c +++ b/security/keys/user_defined.c @@ -61,7 +61,7 @@ int user_preparse(struct key_preparsed_payload *prep) struct user_key_payload *upayload; size_t datalen = prep->datalen; - if (datalen <= 0 || datalen > 32767 || !prep->data) + if (datalen == 0 || datalen > 32767 || !prep->data) return -EINVAL; upayload = kmalloc(sizeof(*upayload) + datalen, GFP_KERNEL); -- cgit v1.2.3