]> 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>
Fri, 2 Jan 2026 11:57:14 +0000 (12:57 +0100)
commit9f4bc5c304028795ac525b31192534b4bd7ca272
treede202483edc8e3bb11e3ed96a56afa40a27ca590
parent7501ecfe3e5202490c2d13dc7e181203601fcd69
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