]> 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>
Sun, 11 Jan 2026 14:19:27 +0000 (15:19 +0100)
commita5b62594160eb6dbc112e2d51e7fa8e9cd6d4ca8
tree25a512dd1eadcdba384c9dbac3410f44540669be
parentfc8affcc7e04ad4d928a73c435746998547c5b1a
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