Commit 00fb7e14 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

usb: dwc3: of-simple: fix use-after-free on remove

[ Upstream commit 896e5188 ]

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: 16adc674 ("usb: dwc3: add generic OF glue layer")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e7a0393b
......@@ -132,8 +132,9 @@ static int dwc3_of_simple_remove(struct platform_device *pdev)
of_platform_depopulate(dev);
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
pm_runtime_put_noidle(dev);
pm_runtime_set_suspended(dev);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment