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]
Message-ID: <D717C3AD-1753-4785-80EA-B20A17506750@oracle.com>
Date:   Mon, 18 Oct 2021 14:20:47 +0000
From:   Himanshu Madhani <himanshu.madhani@...cle.com>
To:     Zheyu Ma <zheyuma97@...il.com>
CC:     Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream <GR-QLogic-Storage-Upstream@...vell.com>,
        "James E . J . Bottomley" <jejb@...ux.ibm.com>,
        Martin Petersen <martin.petersen@...cle.com>,
        linux-scsi <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scsi: qla2xxx: Return -ENOMEM if kzalloc() fails



> On Oct 17, 2021, at 8:56 PM, Zheyu Ma <zheyuma97@...il.com> wrote:
> 
> During the process of driver probing, probe function should return < 0
> for failure, otherwise kernel will treat value > 0 as success.
> 
> Signed-off-by: Zheyu Ma <zheyuma97@...il.com>
> ---
> drivers/scsi/qla2xxx/qla_os.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index d2e40aaba734..836fedcea241 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -4157,7 +4157,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
> 					ql_dbg_pci(ql_dbg_init, ha->pdev,
> 					    0xe0ee, "%s: failed alloc dsd\n",
> 					    __func__);
> -					return 1;
> +					return -ENOMEM;
> 				}
> 				ha->dif_bundle_kallocs++;
> 
> -- 
> 2.17.6
> 

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