Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Colin Ian King and committed by
Paul Moore
241d6a66 7ccbe076

+1 -3
+1 -3
security/security.c
··· 4138 4138 if (base) 4139 4139 uctx = (struct lsm_ctx __user *)(base + total); 4140 4140 rc = scall->hl->hook.getselfattr(attr, uctx, &entrysize, flags); 4141 - if (rc == -EOPNOTSUPP) { 4142 - rc = 0; 4141 + if (rc == -EOPNOTSUPP) 4143 4142 continue; 4144 - } 4145 4143 if (rc == -E2BIG) { 4146 4144 rc = 0; 4147 4145 left = 0;