summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2018-05-31 16:45:52 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-06-18 11:41:00 +0200
commit896e518883f18e601335908192e33426c1f599a4 (patch)
tree0952cd38a8133342455738b47363273af1f20fda /drivers/usb
parentusb: dwc2: gadget: Fix issue in dwc2_gadget_start_isoc() (diff)
downloadlinux-896e518883f18e601335908192e33426c1f599a4.tar.xz
linux-896e518883f18e601335908192e33426c1f599a4.zip
usb: dwc3: of-simple: fix use-after-free on remove
The clocks have already been explicitly disabled and put as part of remove() so the runtime suspend callback must not be run when balancing the runtime PM usage count before returning. Fixes: 16adc674d0d6 ("usb: dwc3: add generic OF glue layer") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/dwc3-of-simple.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c
index 6b3ccd542bd7..dbeff5e6ad14 100644
--- a/drivers/usb/dwc3/dwc3-of-simple.c
+++ b/drivers/usb/dwc3/dwc3-of-simple.c
@@ -165,8 +165,9 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
reset_control_put(simple->resets);
- pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
+ pm_runtime_put_noidle(dev);
+ pm_runtime_set_suspended(dev);
return 0;
}