[lvc-project] [PATCH] ssb: Fix potential NULL pointer dereference in ssb_device_uevent

Michael Büsch m at bues.ch
Thu Feb 29 21:08:54 MSK 2024


On Thu, 29 Feb 2024 12:37:56 +0300
Rand Deeb <rand.sec96 at gmail.com> wrote:

>  static int ssb_device_uevent(struct device *dev, struct kobj_uevent_env *env)
>  {
> -	struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);
> +	struct ssb_device *ssb_dev;
>  
>  	if (!dev)
>  		return -ENODEV;
>  
> +	ssb_dev = dev_to_ssb_dev(dev);
> +
>  	return add_uevent_var(env,
>  			     "MODALIAS=ssb:v%04Xid%04Xrev%02X",
>  			     ssb_dev->id.vendor, ssb_dev->id.coreid,

Good catch.
Acked-by: Michael Büsch <m at bues.ch>


-- 
Michael Büsch
https://bues.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20240229/b7e25c3f/attachment.pgp>


More information about the lvc-project mailing list