]> git.ipfire.org Git - thirdparty/kernel/linux.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>
Tue, 23 Dec 2025 14:48:46 +0000 (15:48 +0100)
commit782be79e4551550d7a82b1957fc0f7347e6d461f
tree019ca286bf53695a955face385970cf032d0505d
parent5106dbab44fba8ec6dede3f4e75d17f5aa777ec8
usb: gadget: lpc32xx_udc: fix clock imbalance in error path

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