]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: lpc32xx_udc: fix clock imbalance in error path
authorJohan Hovold <johan@kernel.org>
Thu, 18 Dec 2025 15:35:15 +0000 (16:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:12:07 +0000 (13:12 +0100)
commite1e8f554d86cd65c79a436719243059fe473a807
tree9ef7c73f866251e9c2e21083843103e2dbdd35ed
parent25504f7fe60058b2a9553a9e424fb7dd9683843e
usb: gadget: lpc32xx_udc: fix clock imbalance in error path

commit 782be79e4551550d7a82b1957fc0f7347e6d461f upstream.

A recent change fixing a device reference leak introduced a clock
imbalance by reusing an error path so that the clock may be disabled
before having been enabled.

Note that the clock framework allows for passing in NULL clocks so there
is no risk for a NULL pointer dereference.

Also drop the bogus I2C client NULL check added by the offending commit
as the pointer has already been verified to be non-NULL.

Fixes: c84117912bdd ("USB: lpc32xx_udc: Fix error handling in probe")
Cc: stable@vger.kernel.org
Cc: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://patch.msgid.link/20251218153519.19453-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/lpc32xx_udc.c