Skip to content

Commit 74851fb

Browse files
ISCAS-Vulabgregkh
authored andcommitted
usb: gadget: renesas_usbf: Handle devm_pm_runtime_enable() errors
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: 3e6e14f ("usb: gadget: udc: add Renesas RZ/N1 USBF controller support") Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Acked-by: Herve Codina <herve.codina@bootlin.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20251124022215.1619-1-vulab@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent df5fde2 commit 74851fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/usb/gadget/udc/renesas_usbf.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3262,7 +3262,9 @@ static int usbf_probe(struct platform_device *pdev)
32623262
if (IS_ERR(udc->regs))
32633263
return PTR_ERR(udc->regs);
32643264

3265-
devm_pm_runtime_enable(&pdev->dev);
3265+
ret = devm_pm_runtime_enable(&pdev->dev);
3266+
if (ret)
3267+
return ret;
32663268
ret = pm_runtime_resume_and_get(&pdev->dev);
32673269
if (ret < 0)
32683270
return ret;

0 commit comments

Comments
 (0)