Re: [PATCH] PCI/pwrctrl: Fix double cleanup on devm_add_action_or_reset() failure

From: Bartosz Golaszewski
Date: Tue Jun 10 2025 - 04:12:12 EST


On Wed, Jun 4, 2025 at 10:38 AM Geert Uytterhoeven
<geert+renesas@xxxxxxxxx> wrote:
>
> When devm_add_action_or_reset() fails, it calls the passed cleanup
> function. Hence the caller must not repeat that cleanup.
>
> Replace the "goto err_regulator_free" by the actual freeing, as there
> will never be a need again for a second user of this label.
>
> Fixes: 75996c92f4de309f ("PCI/pwrctrl: Add pwrctrl driver for PCI slots")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> ---
> Compile-tested only.
> ---

Acked-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>