]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: gadget: renesas_usbf: Handle devm_pm_runtime_enable() errors
authorHaotian Zhang <vulab@iscas.ac.cn>
Mon, 24 Nov 2025 02:22:15 +0000 (10:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Nov 2025 17:00:45 +0000 (18:00 +0100)
commit74851fbb6d647304f8a7dc491434d3a335ef4b8d
tree3d99c37f5ea8c5d6a41f2f621731d8f2eecd804c
parentdf5fde297e617041449f603ed5f646861c80000b
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: 3e6e14ffdea4 ("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>
drivers/usb/gadget/udc/renesas_usbf.c