summaryrefslogtreecommitdiff
path: root/security/keys/user_defined.c
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-10-11 16:48:24 +0200
committerJarkko Sakkinen <jarkko@kernel.org>2025-11-27 23:50:20 +0200
commit58b46219bfcf1906b795307372b0d50d65115026 (patch)
treea90c28ee27a5ab0244cf178891f51ebcdaf73f64 /security/keys/user_defined.c
parente1afacb68573c3cd0a3785c6b0508876cd3423bc (diff)
downloadlinux-next-58b46219bfcf1906b795307372b0d50d65115026.tar.gz
linux-next-58b46219bfcf1906b795307372b0d50d65115026.zip
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 <thorsten.blum@linux.dev> Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'security/keys/user_defined.c')
-rw-r--r--security/keys/user_defined.c2
1 files changed, 1 insertions, 1 deletions
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);