Skip to content

Commit 583a421

Browse files
net147gregkh
authored andcommitted
usb: musb: sunxi: Explicitly release USB PHY on exit
commit 6ed05c68cbcae42cd52b8e53b66952bfa9c002ce upstream. 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. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Bin Liu <b-liu@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d68b07a commit 583a421

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/usb/musb/sunxi.c

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

323+
devm_usb_put_phy(glue->dev, glue->xceiv);
324+
323325
return 0;
324326
}
325327

0 commit comments

Comments
 (0)