]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: of-simple: fix clock resource leak in dwc3_of_simple_probe
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 11 Dec 2025 06:49:36 +0000 (10:49 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:11:49 +0000 (13:11 +0100)
commit5f31cc409785304b39c595b5a897d59dd7142bcb
treee2e79b54537da2b53e7ef4f3afd8f81b985bf5e9
parent21c7c83d592e6335bfb6d65608da3726f976bad4
usb: dwc3: of-simple: fix clock resource leak in dwc3_of_simple_probe

commit 3b4961313d31e200c9e974bb1536cdea217f78b5 upstream.

When clk_bulk_prepare_enable() fails, the error path jumps to
err_resetc_assert, skipping clk_bulk_put_all() and leaking the
clock references acquired by clk_bulk_get_all().

Add err_clk_put_all label to properly release clock resources
in all error paths.

Found via static analysis and code review.

Fixes: c0c61471ef86 ("usb: dwc3: of-simple: Convert to bulk clk API")
Cc: stable <stable@kernel.org>
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://patch.msgid.link/20251211064937.2360510-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-of-simple.c