Skip to content

Commit b4c61e5

Browse files
jhovoldgregkh
authored andcommitted
usb: ohci-nxp: fix device leak on probe failure
Make sure to drop the reference taken when looking up the PHY I2C device during probe on probe failure (e.g. probe deferral) and on driver unbind. Fixes: 73108aa ("USB: ohci-nxp: Use isp1301 driver") Cc: stable@vger.kernel.org # 3.5 Reported-by: Ma Ke <make24@iscas.ac.cn> Link: https://lore.kernel.org/lkml/20251117013428.21840-1-make24@iscas.ac.cn/ Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Link: https://patch.msgid.link/20251218153519.19453-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b4b64fd commit b4c61e5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/usb/host/ohci-nxp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
223223
fail_resource:
224224
usb_put_hcd(hcd);
225225
fail_disable:
226+
put_device(&isp1301_i2c_client->dev);
226227
isp1301_i2c_client = NULL;
227228
return ret;
228229
}
@@ -234,6 +235,7 @@ static void ohci_hcd_nxp_remove(struct platform_device *pdev)
234235
usb_remove_hcd(hcd);
235236
ohci_nxp_stop_hc();
236237
usb_put_hcd(hcd);
238+
put_device(&isp1301_i2c_client->dev);
237239
isp1301_i2c_client = NULL;
238240
}
239241

0 commit comments

Comments
 (0)