From: Yoshihiro Shimoda Date: Fri, 12 Jan 2018 11:00:56 +0000 (+0900) Subject: usb: gadget: udc: renesas_usb3: fix oops in renesas_usb3_remove() X-Git-Tag: v4.16-rc3~19^2~2^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3190868e5f52fb26544f16463593d54ce46ce61;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index 6e87af2483679..409cde4e6a516 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; }