Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp7078908pxu; Fri, 25 Dec 2020 00:56:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1GRxA2zwVx90DuGz91yLXXEjiTLb0l1oiW7fSX3pcnBKdaZsHHHHairQqrp8uU2+c28/4 X-Received: by 2002:a50:ab59:: with SMTP id t25mr31446071edc.364.1608886600531; Fri, 25 Dec 2020 00:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608886600; cv=none; d=google.com; s=arc-20160816; b=XCPAfWABAc01gBsjjQfAzCsjw0mSqsY/HFOIi2Nt6S9aFwq4pi3QnNi18ZOVANEGdU 0CMpT4Q7wa2DlZtTKkeGOXdpaObbY7EPVIj78ijPD3D7gsu+4EuQpa9VF7cMSXbmPC4o LxM9yMIc4FPoZUUEZwzf1+zpjkxDCzrgNHZyx8dWXeT/v9MlszaEyw0gVcNgoTJAPBjk nyPZUrNylWKJWDlUdsZzGh5S9lzFDQE2JAqQJJUkKQ1W9Jr+jTRCBEQy+wQR5kZC+75E hwJhpNlTyNKReliRoFpmT8jLTRrFjQMrD2je1IuZL1BHZ31JCgqiC/61+IuZu6VHbI5g OyTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=fMN3iMT5dQiG3mH/GPwnAQiz+0lp0wmVNkQaU/ObCyQ=; b=vMglKirl9liZszYLmNxj671lO1DrYY0aszf1p1HTouo4xGAPT3krx6mwm6pY6WnEX5 nsjwU817ND3aePbTo4iuXKp0SWToRezreMaWFLf0oSpQoNgvb5Uh9Mujs1ArbTW2r8av 5arXOYxiA9hX3FUrjwfA31kjdFg3fJ/foqYn1i2Uj+8AecsI0KJL0xstEzjHIjCrP6Fq WYXzkaRovGyt4suVgz5fgyK2YPL598prmg5wqr0754CBppGjKErgC1dpxa6ZNZHHhAE3 k54KQ5iO1ZQdOSchdabeRTXnTYAheqpRhIGXmhpeYKGPbADss0MbfC2SK3mwy1ctSDN3 sS4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si17103851edp.96.2020.12.25.00.56.18; Fri, 25 Dec 2020 00:56:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729087AbgLYIzG (ORCPT + 99 others); Fri, 25 Dec 2020 03:55:06 -0500 Received: from smtp23.cstnet.cn ([159.226.251.23]:34524 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725863AbgLYIzF (ORCPT ); Fri, 25 Dec 2020 03:55:05 -0500 Received: from localhost.localdomain (unknown [124.16.141.241]) by APP-03 (Coremail) with SMTP id rQCowABnb8OQqOVfvmWoAA--.14888S2; Fri, 25 Dec 2020 16:53:36 +0800 (CST) From: Xu Wang To: njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] scsi: qla2xxx: Remove redundant NULL check Date: Fri, 25 Dec 2020 08:53:33 +0000 Message-Id: <20201225085333.65091-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowABnb8OQqOVfvmWoAA--.14888S2 X-Coremail-Antispam: 1UD129KBjvdXoW7XrWfGr43Xr4UXF13WFWkCrg_yoWkWFXEvr WjqryIqr1UWw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linux-kernel@vger.kernel.org Fix warnings reported by coccicheck: ./drivers/scsi/qla2xxx/qla_os.c:4636:2-7: WARNING: NULL check before some freeing functions is not needed. ./drivers/scsi/qla2xxx/qla_os.c:4651:3-8: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Xu Wang --- drivers/scsi/qla2xxx/qla_os.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index f80abe28f35a..bc7bff3539b4 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4632,8 +4632,7 @@ qla2x00_free_fw_dump(struct qla_hw_data *ha) dma_free_coherent(&ha->pdev->dev, EFT_SIZE, ha->eft, ha->eft_dma); - if (ha->fw_dump) - vfree(ha->fw_dump); + vfree(ha->fw_dump); ha->fce = NULL; ha->fce_dma = 0; @@ -4647,8 +4646,7 @@ qla2x00_free_fw_dump(struct qla_hw_data *ha) ha->fw_dump_len = 0; for (j = 0; j < 2; j++, fwdt++) { - if (fwdt->template) - vfree(fwdt->template); + vfree(fwdt->template); fwdt->template = NULL; fwdt->length = 0; } -- 2.17.1