lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Apr 2021 14:15:55 +0000
From:   Himanshu Madhani <himanshu.madhani@...cle.com>
To:     Qiheng Lin <linqiheng@...wei.com>
CC:     "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Martin Petersen <martin.petersen@...cle.com>,
        Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream <GR-QLogic-Storage-Upstream@...vell.com>,
        linux-scsi <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] scsi: qla2xxx: remove unneeded if-null-free check



> On Apr 9, 2021, at 7:09 AM, Qiheng Lin <linqiheng@...wei.com> wrote:
> 
> Eliminate the following coccicheck warning:
> 
> drivers/scsi/qla2xxx/qla_os.c:4622:2-7:
> WARNING: NULL check before some freeing functions is not needed.
> drivers/scsi/qla2xxx/qla_os.c:4637:3-8:
> WARNING: NULL check before some freeing functions is not needed.
> 
> Signed-off-by: Qiheng Lin <linqiheng@...wei.com>
> ---
> 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 12959e3874cb..d74c32f84ef5 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -4618,8 +4618,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;
> @@ -4633,8 +4632,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.31.1
> 

Looks Good. 

Reviewed-by: Himanshu Madhani <himanshu.madhani@...cle.com>

--
Himanshu Madhani	 Oracle Linux Engineering

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ