[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdUSPSjh4nQ1B6NJdYZw3qW30Tx5zci6vy_9Hy6BS64FWQ@mail.gmail.com>
Date: Mon, 24 Nov 2025 14:15:14 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: herve.codina@...tlin.com, gregkh@...uxfoundation.org,
linux-renesas-soc@...r.kernel.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: renesas_usbf: Handle devm_pm_runtime_enable()
errors
Hi Haotian,
On Mon, 24 Nov 2025 at 03:24, Haotian Zhang <vulab@...as.ac.cn> wrote:
> devm_pm_runtime_enable() can fail due to memory allocation.
> The current code ignores its return value, potentially causing
> pm_runtime_resume_and_get() to operate on uninitialized runtime
> PM state.
>
> Check the return value of devm_pm_runtime_enable() and return on failure.
>
> Fixes: 3e6e14ffdea4 ("usb: gadget: udc: add Renesas RZ/N1 USBF controller support")
> Signed-off-by: Haotian Zhang <vulab@...as.ac.cn>
Thanks for your patch!
> --- a/drivers/usb/gadget/udc/renesas_usbf.c
> +++ b/drivers/usb/gadget/udc/renesas_usbf.c
> @@ -3262,7 +3262,9 @@ static int usbf_probe(struct platform_device *pdev)
> if (IS_ERR(udc->regs))
> return PTR_ERR(udc->regs);
>
> - devm_pm_runtime_enable(&pdev->dev);
> + ret = devm_pm_runtime_enable(&pdev->dev);
> + if (ret)
> + return ret;
Perhaps insert a blank line here?
> ret = pm_runtime_resume_and_get(&pdev->dev);
> if (ret < 0)
> return ret;
Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists