Skip to content

Commit 241d6a6

Browse files
ColinIanKingpcmoore
authored andcommitted
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 <[email protected]> Reviewed-by: Serge Hallyn <[email protected]> [PM: subj tweak] Signed-off-by: Paul Moore <[email protected]>
1 parent 7ccbe07 commit 241d6a6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

security/security.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4138,10 +4138,8 @@ int security_getselfattr(unsigned int attr, struct lsm_ctx __user *uctx,
41384138
if (base)
41394139
uctx = (struct lsm_ctx __user *)(base + total);
41404140
rc = scall->hl->hook.getselfattr(attr, uctx, &entrysize, flags);
4141-
if (rc == -EOPNOTSUPP) {
4142-
rc = 0;
4141+
if (rc == -EOPNOTSUPP)
41434142
continue;
4144-
}
41454143
if (rc == -E2BIG) {
41464144
rc = 0;
41474145
left = 0;

0 commit comments

Comments
 (0)