smack: lsm: remove the unneeded result variable
authorXu Panda <xu.panda@zte.com.cn>
Mon, 12 Sep 2022 10:05:36 +0000 (10:05 +0000)
committerCasey Schaufler <casey@schaufler-ca.com>
Tue, 27 Sep 2022 17:33:03 +0000 (10:33 -0700)
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>
security/smack/smack_lsm.c

index 077bf6f..de7db0b 100644 (file)
@@ -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__);
 }
 
 /**