summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorXu Panda <xu.panda@zte.com.cn>2022-09-12 12:05:36 +0200
committerCasey Schaufler <casey@schaufler-ca.com>2022-09-27 19:33:03 +0200
commitd3f84f5c9627576b555976c7584514a2ca3ed02e (patch)
treef93648e1e5badabca975d5b553ca064773d958fd /security
parentSMACK: Add sk_clone_security LSM hook (diff)
downloadlinux-d3f84f5c9627576b555976c7584514a2ca3ed02e.tar.xz
linux-d3f84f5c9627576b555976c7584514a2ca3ed02e.zip
smack: lsm: remove the unneeded result variable
Return the value smk_ptrace_rule_check() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Xu Panda <xu.panda@zte.com.cn> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Diffstat (limited to 'security')
-rw-r--r--security/smack/smack_lsm.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 077bf6fd569b..de7db0b18cd5 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -496,13 +496,11 @@ static int smack_ptrace_access_check(struct task_struct *ctp, unsigned int mode)
*/
static int smack_ptrace_traceme(struct task_struct *ptp)
{
- int rc;
struct smack_known *skp;
skp = smk_of_task(smack_cred(current_cred()));
- rc = smk_ptrace_rule_check(ptp, skp, PTRACE_MODE_ATTACH, __func__);
- return rc;
+ return smk_ptrace_rule_check(ptp, skp, PTRACE_MODE_ATTACH, __func__);
}
/**