From: Yunfeng Ye Date: Wed, 23 Oct 2019 13:27:34 +0000 (+0800) Subject: audit: remove redundant condition check in kauditd_thread() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c34c78dfc1fc68a1f5403f996de8ca62f298d7b2;p=linux.git audit: remove redundant condition check in kauditd_thread() Warning is found by the code analysis tool: "the condition 'if(ac && rc < 0)' is redundant: ac" The @ac variable has been checked before. It can't be a null pointer here, so remove the redundant condition check. Signed-off-by: Yunfeng Ye Signed-off-by: Paul Moore --- diff --git a/kernel/audit.c b/kernel/audit.c index d75485aa25ff3..8e09f0f55b4b0 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -830,7 +830,7 @@ static int kauditd_thread(void *dummy) rc = kauditd_send_queue(sk, portid, &audit_hold_queue, UNICAST_RETRIES, NULL, kauditd_rehold_skb); - if (ac && rc < 0) { + if (rc < 0) { sk = NULL; auditd_reset(ac); goto main_queue; @@ -840,7 +840,7 @@ static int kauditd_thread(void *dummy) rc = kauditd_send_queue(sk, portid, &audit_retry_queue, UNICAST_RETRIES, NULL, kauditd_hold_skb); - if (ac && rc < 0) { + if (rc < 0) { sk = NULL; auditd_reset(ac); goto main_queue;