Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1276306ybg; Wed, 23 Oct 2019 13:09:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0gNR4YJfpDfClYOUCMCs21sbHCeXoKZ5Z5YXfxqaG3QLEKDLIRathuUdi7dh0DScIpoKz X-Received: by 2002:a05:6402:1816:: with SMTP id g22mr7575055edy.76.1571861387466; Wed, 23 Oct 2019 13:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571861387; cv=none; d=google.com; s=arc-20160816; b=yVENN1FzfqC/WRKIayyceiWTT96YSrY9Zr4Qli4B4SXBKJtrCv+XOs/cao+5VQDwnf I8rYQ4cnW4PrJR3Rlgl9fylzETENK+x14ie+e0vzWEUTmAV4SBjYL1GILI0bDATzXWGt GvbPCBeLPC53+SQc64admUtX75Uj9wsZ6KnapNA6zZxRXJbtZyFTZhD4CP4sGHiKOT58 XrXCT0DjWRrRHAyeT13ICRqErPOdMVU8fZhc3aG4YGD1xNDbKuAVXstyb1j7t1zcbhzn i6SZc/U104qUU/x0ZXY515r42i1RcNCcFhukZrwEFbFr0QQSdawkBuW50fKGAqz6ybPd LlNQ== 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:mime-version:user-agent:date:message-id:subject :from:cc:to; bh=3umgEeW7aMZvCQvUicn3e9e2ni77HCU79H70HvG4W6E=; b=FCV2bYUKZdVPtKWAVIfKVdfkpuEj4gPuBMjsh8JiH+/D/82Hpe6ymdAQhMzQR+eeBo XBZk1FOg7YEsBHBaAq3PcmdcY9/jywmP+ZGXR0Em0rgGGArZuPnnzcUC5tzx8I5jPUc8 UwxZoLWBx8FINxI7rYQ4OsVU62thBjij4Pjcw0fbDRttk44JlCXp3xVtJgkI34rTbfTI dIOvxsit2MuwVRicD22+t/dKRHG1BW9u+qITQhMqTqppFRjA6gyHkQX5Ohciy/Aa+T7p rIWCNMJJv2BWHF75hKNJhGNmCXe6nTlOMIre4EwJfoKrXwB9HVTEGvkl7zJTuA/VpFxn Q5kg== 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 hh9si12686312ejb.313.2019.10.23.13.09.22; Wed, 23 Oct 2019 13:09:47 -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 S2405877AbfJWN14 (ORCPT + 99 others); Wed, 23 Oct 2019 09:27:56 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59390 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2405872AbfJWN1z (ORCPT ); Wed, 23 Oct 2019 09:27:55 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 339D1C4DD676861ED316; Wed, 23 Oct 2019 21:27:47 +0800 (CST) Received: from [127.0.0.1] (10.177.251.225) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Wed, 23 Oct 2019 21:27:38 +0800 To: , CC: , , "hushiyuan@huawei.com" , "linfeilong@huawei.com" From: Yunfeng Ye Subject: [PATCH] audit: remove redundant condition check in kauditd_thread() Message-ID: <7869bb43-5cb1-270a-07d1-31574595e13e@huawei.com> Date: Wed, 23 Oct 2019 21:27:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 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 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(-) 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