Re: [PATCH 1/6] usb: core: add missing pm_runtime_dont_use_autosuspend() call

From: Joshua Crofts

Date: Wed Sep 16 2026 - 04:24:36 EST


On Wed, 16 Sep 2026 10:08:52 +0200
Johan Hovold <johan@xxxxxxxxxx> wrote:

> On Tue, Sep 15, 2026 at 09:02:18AM +0000, Joshua Crofts wrote:
> > The fail label in usb_new_device() disables pm_runtime on failure, but
> > doesn't call pm_runtime_dont_use_autosuspend(), causing resource leaks.
>
> No it does not, as the device itself is about to be freed. Sure we could
> disable autosuspend again here, but it does not really matter.
>

Okay, commit message aside, you still need to call dont_use_autosuspend()
on teardown as the driver doesn't use the devm_* counterparts. Currently
(according to my cocci SmPL [1]) there are 195 instances of this in the kernel.

...

> But this one should not have a Fixes tag and does not need to be
> backported.

Yeah, you already mentioned this in IIO once [2]. I found several instances
of patches like these being backported however, so perhaps times have changed.

[1] https://lore.kernel.org/cocci/20260915064327.1377-1-joshua.crofts1@xxxxxxxxx/
[2] https://lore.kernel.org/linux-iio/aoQEyeHUiTwWenBL@xxxxxxxxxxxxxxxxxxxx/



--
Kind regards,
Joshua Crofts