]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: musb: omap2430: Fix use-after-free in omap2430_probe()
authorWentao Liang <vulab@iscas.ac.cn>
Thu, 9 Apr 2026 10:11:04 +0000 (10:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 May 2026 08:33:43 +0000 (10:33 +0200)
commite194ce048f5a6c549b3a23a8c568c6470f40f772
treec88c573ea9f9483e4746cbd0e002a2ccf3ad9db4
parentd98d413ca65d0790a8f3695d0a5845538958ab84
usb: musb: omap2430: Fix use-after-free in omap2430_probe()

In omap2430_probe(), of_node_put(np) is called prematurely before the
last access to np, leading to a use-after-free if the node's reference
count drops to zero. Move the of_node_put() calls after the last use of
np in both the success and error paths.

Fixes: ffbe2feac59b ("usb: musb: omap2430: Fix probe regression for missing resources")
Cc: stable <stable@kernel.org>
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260409101104.480623-1-vulab@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/omap2430.c