[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9834be77-29e0-4a65-93f6-b61bf724f922@rowland.harvard.edu>
Date: Mon, 17 Nov 2025 09:56:18 -0500
From: Alan Stern <stern@...land.harvard.edu>
To: Arnd Bergmann <arnd@...db.de>
Cc: Ma Ke <make24@...as.ac.cn>, Vladimir Zapolskiy <vz@...ia.com>,
piotr.wojtaszczyk@...esys.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, stigge@...com.de,
linux-usb@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>, stable@...r.kernel.org
Subject: Re: [PATCH v2] USB: ohci-nxp: Fix error handling in ohci-hcd-nxp
driver
On Mon, Nov 17, 2025 at 09:53:21AM +0100, Arnd Bergmann wrote:
> On Mon, Nov 17, 2025, at 02:34, Ma Ke wrote:
> > When obtaining the ISP1301 I2C client through the device tree, the
> > driver does not release the device reference in the probe failure path
> > or in the remove function. This could cause a reference count leak,
> > which may prevent the device from being properly unbound or freed,
> > leading to resource leakage.
> >
> > Fix this by storing whether the client was obtained via device tree
> > and only releasing the reference in that case.
> >
> > Found by code review.
> >
> > Cc: stable@...r.kernel.org
> > Fixes: 73108aa90cbf ("USB: ohci-nxp: Use isp1301 driver")
> > Signed-off-by: Ma Ke <make24@...as.ac.cn>
>
> The patch looks fine in principle, however I don't see any way
> this driver would be probed without devicetree, and I think
> it would be better to remove all the traces of the pre-DT
> logic in it.
>
> The lpc32xx platform was converted to DT back in 2012, so
> any reference to the old variant is dead code. Something like
> the patch below should work here.
>
> Other thoughts on this driver, though I I'm not sure anyone
> is going to have the energy to implement these:
>
> - the reference to isp1301_i2c_client should be kept in
> the hcd private data, after allocating a structure, by
> setting driver->hcd_priv_size.
> - instead of looking for the i2c device, I would suppose
> it should look for a usb_phy instead, as there is no
> guarantee on the initialization being ordered at the
> moment.
> - instead of a usb_phy, the driver should probably use
> a generic phy (a much larger rework).
Considering what the comments at the start of the file say:
* Currently supported OHCI host devices:
* - NXP LPC32xx
* NOTE: This driver does not have suspend/resume functionality
* This driver is intended for engineering development purposes only
I wonder whether any existing systems actually use this driver.
Alan Stern
Powered by blists - more mailing lists