Skip to content

Commit 498dbd9

Browse files
zijun-hugregkh
authored andcommitted
usb: musb: sunxi: Fix accessing an released usb phy
Commit 6ed05c6 ("usb: musb: sunxi: Explicitly release USB PHY on exit") will cause that usb phy @glue->xceiv is accessed after released. 1) register platform driver @sunxi_musb_driver // get the usb phy @glue->xceiv sunxi_musb_probe() -> devm_usb_get_phy(). 2) register and unregister platform driver @musb_driver musb_probe() -> sunxi_musb_init() use the phy here //the phy is released here musb_remove() -> sunxi_musb_exit() -> devm_usb_put_phy() 3) register @musb_driver again musb_probe() -> sunxi_musb_init() use the phy here but the phy has been released at 2). ... Fixed by reverting the commit, namely, removing devm_usb_put_phy() from sunxi_musb_exit(). Fixes: 6ed05c6 ("usb: musb: sunxi: Explicitly release USB PHY on exit") Cc: [email protected] Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 59b723c commit 498dbd9

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/usb/musb/sunxi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,6 @@ static int sunxi_musb_exit(struct musb *musb)
293293
if (test_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags))
294294
sunxi_sram_release(musb->controller->parent);
295295

296-
devm_usb_put_phy(glue->dev, glue->xceiv);
297-
298296
return 0;
299297
}
300298

0 commit comments

Comments
 (0)