[PATCH 1/6] usb: core: add missing pm_runtime_dont_use_autosuspend() call
Joshua Crofts
joshua.crofts1 at gmail.com
Tue Sep 15 02:02:18 PDT 2026
The fail label in usb_new_device() disables pm_runtime on failure, but
doesn't call pm_runtime_dont_use_autosuspend(), causing resource leaks.
Add the missing pm_runtime_dont_use_autosuspend() call.
Found using Coccinelle.
Fixes: fcc4a01eb866 ("USB: use the runtime-PM autosuspend implementation")
Cc: <stable at vger.kernel.org>
Signed-off-by: Joshua Crofts <joshua.crofts1 at gmail.com>
---
drivers/usb/core/hub.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 3345b3298daf..dec6d5c49759 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2745,6 +2745,7 @@ int usb_new_device(struct usb_device *udev)
fail:
usb_set_device_state(udev, USB_STATE_NOTATTACHED);
pm_runtime_disable(&udev->dev);
+ pm_runtime_dont_use_autosuspend(&udev->dev);
pm_runtime_set_suspended(&udev->dev);
return err;
}
--
2.47.3
More information about the linux-arm-kernel
mailing list