summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2024-11-12 12:45:32 +0000
committerPaul Moore <paul@paul-moore.com>2025-01-04 21:52:13 -0500
commit241d6a66404c975415fd0facaf70d61b37248f50 (patch)
treef80b7ad3abc321ce47b482cd2f3b4649399d89a4 /security
parent7ccbe076d987598b04b4b9c9b61f042291f9cc77 (diff)
downloadlinux-241d6a66404c975415fd0facaf70d61b37248f50.tar.gz
linux-241d6a66404c975415fd0facaf70d61b37248f50.tar.bz2
linux-241d6a66404c975415fd0facaf70d61b37248f50.zip
security: remove redundant assignment to return variable
In the case where rc is equal to EOPNOTSUPP it is being reassigned a new value of zero that is never read. The following continue statement loops back to the next iteration of the lsm_for_each_hook loop and rc is being re-assigned a new value from the call to getselfattr. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reviewed-by: Serge Hallyn <serge@hallyn.com> [PM: subj tweak] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r--security/security.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/security/security.c b/security/security.c
index 7523d14f31fb..39df4451455b 100644
--- a/security/security.c
+++ b/security/security.c
@@ -4138,10 +4138,8 @@ int security_getselfattr(unsigned int attr, struct lsm_ctx __user *uctx,
if (base)
uctx = (struct lsm_ctx __user *)(base + total);
rc = scall->hl->hook.getselfattr(attr, uctx, &entrysize, flags);
- if (rc == -EOPNOTSUPP) {
- rc = 0;
+ if (rc == -EOPNOTSUPP)
continue;
- }
if (rc == -E2BIG) {
rc = 0;
left = 0;