summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2018-01-12 20:00:56 +0900
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-02-12 10:45:49 +0200
commite3190868e5f52fb26544f16463593d54ce46ce61 (patch)
treea556166a4bd92450e8880ae00811e4c6beae19dc /drivers/usb
parentbff52352e0ccc2481f2b6b0d612ff8ff56c50f3a (diff)
downloadlinux-e3190868e5f52fb26544f16463593d54ce46ce61.tar.bz2
usb: gadget: udc: renesas_usb3: fix oops in renesas_usb3_remove()
This patch fixes an issue that the renesas_usb3_remove() causes NULL pointer dereference because the usb3_to_dev() macro will use the gadget instance and it will be deleted before. Fixes: cf06df3fae28 ("usb: gadget: udc: renesas_usb3: move pm_runtime_{en,dis}able()") Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/renesas_usb3.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
index 6e87af248367..409cde4e6a51 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2410,7 +2410,7 @@ static int renesas_usb3_remove(struct platform_device *pdev)
__renesas_usb3_ep_free_request(usb3->ep0_req);
if (usb3->phy)
phy_put(usb3->phy);
- pm_runtime_disable(usb3_to_dev(usb3));
+ pm_runtime_disable(&pdev->dev);
return 0;
}