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] [day] [month] [year] [list]
Date: Fri, 14 Jun 2024 09:25:55 -0700
From: Justin Tee <justintee8345@...il.com>
To: Huai-Yuan Liu <qq810974084@...il.com>
Cc: Justin Tee <justin.tee@...adcom.com>, james.smart@...adcom.com, 
	dick.kennedy@...adcom.com, James.Bottomley@...senpartnership.com, 
	martin.petersen@...cle.com, linux-scsi@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 RESEND] scsi: lpfc: Fix a possible null pointer dereference

Hi Huai-Yuan,

> diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
> index b1c9107d3408..94d968a255ff 100644
> --- a/drivers/scsi/lpfc/lpfc_attr.c
> +++ b/drivers/scsi/lpfc/lpfc_attr.c
> @@ -1904,6 +1904,8 @@ lpfc_xcvr_data_show(struct device *dev, struct device_attribute *attr,
>
>         /* Get transceiver information */
>         rdp_context = kmalloc(sizeof(*rdp_context), GFP_KERNEL);
> +       if (!rdp_context)
> +               goto out_free_rdp;

Understood that kfree(NULL) essentially translates to no-op, but I'd
prefer that we return len here instead of goto out_free_rdp because
there really is nothing to free if kmalloc failed.

Thanks,
Justin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ