From: Yunfeng Ye <yeyunfeng@huawei.com>
To: Paul Moore <paul@paul-moore.com>, <eparis@redhat.com>
Cc: <linux-audit@redhat.com>, <linux-kernel@vger.kernel.org>,
<hushiyuan@huawei.com>, <linfeilong@huawei.com>
Subject: Re: [PATCH] audit: remove redundant condition check in kauditd_thread()
Date: Fri, 25 Oct 2019 15:14:24 +0800 [thread overview]
Message-ID: <a700333e-53b8-1a28-b27d-2ba3f612df2a@huawei.com> (raw)
In-Reply-To: <16e0170d878.280e.85c95baa4474aabc7814e68940a78392@paul-moore.com>
On 2019/10/25 13:43, Paul Moore wrote:
> On October 23, 2019 3:27:50 PM Yunfeng Ye <yeyunfeng@huawei.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@huawei.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
>
>
>
>
>
>
next prev parent reply other threads:[~2019-10-25 7:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 13:27 Yunfeng Ye
2019-10-25 5:43 ` Paul Moore
2019-10-25 7:14 ` Yunfeng Ye [this message]
2019-10-25 15:54 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a700333e-53b8-1a28-b27d-2ba3f612df2a@huawei.com \
--to=yeyunfeng@huawei.com \
--cc=eparis@redhat.com \
--cc=hushiyuan@huawei.com \
--cc=linfeilong@huawei.com \
--cc=linux-audit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@paul-moore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®