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: stable@vger.kernel.org # v4.3+
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>

authored by Jonathan Liu and committed by Greg Kroah-Hartman 6ed05c68 445ef615

+2
+2
drivers/usb/musb/sunxi.c
··· 297 297 if (test_bit(SUNXI_MUSB_FL_HAS_SRAM, &glue->flags)) 298 298 sunxi_sram_release(musb->controller->parent); 299 299 300 + devm_usb_put_phy(glue->dev, glue->xceiv); 301 + 300 302 return 0; 301 303 } 302 304