Skip to content

Commit c34c78d

Browse files
yeyunfeng-devpcmoore
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 245d736 commit c34c78d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/audit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static int kauditd_thread(void *dummy)
830830
rc = kauditd_send_queue(sk, portid,
831831
&audit_hold_queue, UNICAST_RETRIES,
832832
NULL, kauditd_rehold_skb);
833-
if (ac && rc < 0) {
833+
if (rc < 0) {
834834
sk = NULL;
835835
auditd_reset(ac);
836836
goto main_queue;
@@ -840,7 +840,7 @@ static int kauditd_thread(void *dummy)
840840
rc = kauditd_send_queue(sk, portid,
841841
&audit_retry_queue, UNICAST_RETRIES,
842842
NULL, kauditd_hold_skb);
843-
if (ac && rc < 0) {
843+
if (rc < 0) {
844844
sk = NULL;
845845
auditd_reset(ac);
846846
goto main_queue;

0 commit comments

Comments
 (0)