[PATCH net-next 2/3] net: airoha: Add airoha_ppe_dev struct definition

Lorenzo Bianconi lorenzo at kernel.org
Thu Aug 21 23:58:25 PDT 2025


> On Tue, 19 Aug 2025 14:21:07 +0200 Lorenzo Bianconi wrote:
> > +	pdev = of_find_device_by_node(np);
> > +
> 
> did you mean to put the of_node_put() here?
> 
> > +	if (!pdev) {
> > +		dev_err(dev, "cannot find device node %s\n", np->name);
> > +		of_node_put(np);
> > +		return ERR_PTR(-ENODEV);
> > +	}
> > +	of_node_put(np);

I moved the of_node_put() here (and in the if branch) in order to fix a similar
issue fixed by Alok for airoha_npu.

commit 3cd582e7d0787506990ef0180405eb6224fa90a6
Author: Alok Tiwari <alok.a.tiwari at oracle.com>
Date:   Tue Jul 15 07:30:58 2025 -0700

    net: airoha: fix potential use-after-free in airoha_npu_get()

Regards,
Lorenzo

> > +
> > +	if (!try_module_get(THIS_MODULE)) {
> > +		dev_err(dev, "failed to get the device driver module\n");
> > +		goto error_pdev_put;
> > +	}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20250822/d0f5c863/attachment-0001.sig>


More information about the Linux-mediatek mailing list