Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4041162ybg; Fri, 25 Oct 2019 12:28:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzo5Vsu78ZoNelWVrPgHDTFF4MgAVv5ciH5Bu9xkVMaThbR+qEGf/23WTGbHkESJaFNzB+H X-Received: by 2002:a17:906:bcfb:: with SMTP id op27mr4492301ejb.59.1572031695451; Fri, 25 Oct 2019 12:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572031695; cv=none; d=google.com; s=arc-20160816; b=ua1YFgRTkrn2cw812Lykdz/gHwNU1AD9qxDVAYUQJi9ShIL23YCjvpixms73zU6uo5 obGcDdYhZds182MwO4A/7x3UO0GGUhojcVYWUwZCuqMndF+paMdPCC7XiSV0LQ2G0FYA +NDhdbcHX+W6g0rLcANrJ6noYnZoUEODxiLt2vNdSgbvxvH6YqXiK0KKSo8B4pTAphKw QxbUxm7gBl0GSv4ZcpKZ+HRTdoJ9iDR/ndrZ6ALrk4160mt1qqNhRtZtGs97TmEWF542 5Qt2VYtz/xcDDuNYw0puCxhIWk5dW4fjp0DMX8VgTMRxE67afXI9QTmQuPndUBVKUYYI Cl2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=XW+BTEACZ0N2fzTJw6oKyRx4pt1eGrQlL7fKhvdBIyU=; b=zkdXWpekKXHze8y22JT5076Xa/OL/2KKKeX9UlI7I4/N58pPfWwxN91HXQyDGImpBM aFiDpBhUSsePQ8FTTCZgxLv6WgAxtepii4xCdQFZZt1fmpIeDuw02EaB2DRPHE315xJY o8ryIXhRiErTFlNCtJTXkWsFPkaP3i45FekmoTFvMVv21jseniA97tvJmCERr8LbT588 i+eQq1ZT2SRTRMA45wHUeny9qtx7gVInAT23BoNwPflbi3SUHEZYtksPjjvvG90vIBsy a0DCdxDuVhwFJdwitAL5vSiMiMgGHaARYPNvRTIdBOHY1UKeiux3RsToUlWbYSDH0ja9 1tvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gh2si1725144ejb.330.2019.10.25.12.27.51; Fri, 25 Oct 2019 12:28:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406616AbfJYHOy (ORCPT + 99 others); Fri, 25 Oct 2019 03:14:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5179 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2406555AbfJYHOy (ORCPT ); Fri, 25 Oct 2019 03:14:54 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3B05BC9B8F20A4332C18; Fri, 25 Oct 2019 15:14:50 +0800 (CST) Received: from [127.0.0.1] (10.177.251.225) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Fri, 25 Oct 2019 15:14:44 +0800 Subject: Re: [PATCH] audit: remove redundant condition check in kauditd_thread() To: Paul Moore , CC: , , , References: <7869bb43-5cb1-270a-07d1-31574595e13e@huawei.com> <16e0170d878.280e.85c95baa4474aabc7814e68940a78392@paul-moore.com> From: Yunfeng Ye Message-ID: Date: Fri, 25 Oct 2019 15:14:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <16e0170d878.280e.85c95baa4474aabc7814e68940a78392@paul-moore.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.251.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/10/25 13:43, Paul Moore wrote: > On October 23, 2019 3:27:50 PM Yunfeng Ye 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 >> --- >> 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 > > > > > >