Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10590179ybi; Thu, 11 Jul 2019 07:46:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZm8H2MLZ12h6fKxXK9rV8zlAcBWsjFNtc+QZf8mBGL5pzcau4Qxysx6IBXuL0UaT8oCoN X-Received: by 2002:a17:90a:898e:: with SMTP id v14mr5247327pjn.119.1562856369548; Thu, 11 Jul 2019 07:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562856369; cv=none; d=google.com; s=arc-20160816; b=yJXGEMEgl2XDKgO9pi6tlHD6mTOJNEiQmzBcrHi2I9mwg/CimIc36SidXXgx0zoUFP snpFadx78J5GNcv7yT5uzv6si45KWVQJtxRRfwELI+HRB3U+S1MgSzku1gaAc7m+Y0B5 sCfvlWd6jUlwSs9Y5gO5VaxhpzLTENWfCEgWMYKisUnzGU+F8w8vitv71Dn8Ubhl3CEu JqndWqol87IV5oOwh8GWJCdXazG338kASF7l2txcXeqVOlloEWxkrybXHaWdb+YLnUaO Qq/hxTfzoOg8XUT8qNCyI0dsuqu727/e96R4C619JMccYCu2QIfYP+0Eq++/q67yOowF FUgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=HNhwAOeqHnsgcgxUHpAYKcfhV4b8X0rVmVlvVtB3oNg=; b=OSy/gYtHWoi23qPIryWQvHRC3YM52jLwnrxqslUGF6wbh76ahrCDB2idiMWftJ01Xb EBK+J8CRHJLTxgoA81oPbB6NihXBM8xyN7jOIn8OApXZDRmbSonTYd7IaIopVpJqy+LX TrFfupNE9lkAimN/y2NuKMDBpEPt3mfF8P4uN2VBnpjDT1aDO2BJrMdcQ0I/mL5aZK1T Xw7vpS/i76RiRfzmQTKDsWh+RndRhPLeYMJnYH9Z6e97PTbXsWYlk4F454MNouUP4YIl MGagR+IPAXsucR9G0Fr8ZAhW+FENvJ9Wk2gEP46TxHzpX3YCOnJLGhCiOa2ZozvNHlp9 4sSA== 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 e123si5436669pfa.252.2019.07.11.07.45.52; Thu, 11 Jul 2019 07:46:09 -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 S1728488AbfGKOMa (ORCPT + 99 others); Thu, 11 Jul 2019 10:12:30 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2205 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726116AbfGKOM3 (ORCPT ); Thu, 11 Jul 2019 10:12:29 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id EA90B653E1675FDF9488; Thu, 11 Jul 2019 22:12:26 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Thu, 11 Jul 2019 22:12:18 +0800 From: YueHaibing To: , , , CC: , , YueHaibing Subject: [PATCH -next] scsi: lpfc: Remove unnecessary null check before kfree Date: Thu, 11 Jul 2019 22:10:37 +0800 Message-ID: <20190711141037.57880-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A null check before a kfree is redundant, so remove it. This is detected by coccinelle. Signed-off-by: YueHaibing --- drivers/scsi/lpfc/lpfc_bsg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c index b7216d6..c7f6623 100644 --- a/drivers/scsi/lpfc/lpfc_bsg.c +++ b/drivers/scsi/lpfc/lpfc_bsg.c @@ -1276,9 +1276,7 @@ lpfc_bsg_hba_set_event(struct bsg_job *job) return 0; /* call job done later */ job_error: - if (dd_data != NULL) - kfree(dd_data); - + kfree(dd_data); job->dd_data = NULL; return rc; } -- 2.7.4