[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a700333e-53b8-1a28-b27d-2ba3f612df2a@huawei.com>
Date: Fri, 25 Oct 2019 15:14:24 +0800
From: Yunfeng Ye <yeyunfeng@...wei.com>
To: Paul Moore <paul@...l-moore.com>, <eparis@...hat.com>
CC: <linux-audit@...hat.com>, <linux-kernel@...r.kernel.org>,
<hushiyuan@...wei.com>, <linfeilong@...wei.com>
Subject: Re: [PATCH] audit: remove redundant condition check in
kauditd_thread()
On 2019/10/25 13:43, Paul Moore wrote:
> On October 23, 2019 3:27:50 PM Yunfeng Ye <yeyunfeng@...wei.com> wrote:
>> 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 <yeyunfeng@...wei.com>
>> ---
>> kernel/audit.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Hello,
>
> Thank you for the patch. Looking quickly at it, it appears to be correct, unfortunately I'm not in a position to merge non-critical patches, but I expect to merge this next week.
>
ok, thanks.
>
>> diff --git a/kernel/audit.c b/kernel/audit.c
>> index da8dc0db5bd3..193f3a1f4425 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;
>> --
>> 2.7.4.3
>
> --
> paul moore
> www.paul-moore.com
>
>
>
>
>
>
Powered by blists - more mailing lists