summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXu Panda <xu.panda@zte.com.cn>2022-09-12 13:05:36 +0300
committerCasey Schaufler <casey@schaufler-ca.com>2022-09-27 20:33:03 +0300
commitd3f84f5c9627576b555976c7584514a2ca3ed02e (patch)
treef93648e1e5badabca975d5b553ca064773d958fd
parent4ca165fc6c49c3b0100f61524ffbca4743d46e8d (diff)
downloadlinux-d3f84f5c9627576b555976c7584514a2ca3ed02e.tar.xz
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>
-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__);
}
/**