lkml.org 
[lkml]   [2023]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] capabilities: use logical OR
Date
Use logical OR to fix the following sparse warnings:

security/commoncap.c:1358:41: sparse: warning: dubious: !x | y

No functional changes intended.

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
---
security/commoncap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index 0b3fc2f3afe7..b8e34f6204b2 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1355,7 +1355,7 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3,
return commit_creds(new);
}

- if (((!cap_valid(arg3)) | arg4 | arg5))
+ if (((!cap_valid(arg3)) || arg4 || arg5))
return -EINVAL;

if (arg2 == PR_CAP_AMBIENT_IS_SET) {
--
2.34.1
\
 
 \ /
  Last update: 2023-05-30 00:56    [W:0.052 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site