Skip to content

Commit 6ed05c6

Browse files
net147gregkh
authored andcommitted
usb: musb: sunxi: Explicitly release USB PHY on exit
This fixes a kernel oops when unloading the driver due to usb_put_phy being called after usb_phy_generic_unregister when the device is detached. Calling usb_phy_generic_unregister causes x->dev->driver to be NULL in usb_put_phy and results in a NULL pointer dereference. Cc: [email protected] # v4.3+ Signed-off-by: Jonathan Liu <[email protected]> Signed-off-by: Bin Liu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 445ef61 commit 6ed05c6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/usb/musb/sunxi.c

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

300+
devm_usb_put_phy(glue->dev, glue->xceiv);
301+
300302
return 0;
301303
}
302304

0 commit comments

Comments
 (0)