diff options
| author | Ma Ke <make24@iscas.ac.cn> | 2025-12-15 10:09:31 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-12-17 14:53:36 +0100 |
| commit | c84117912bddd9e5d87e68daf182410c98181407 (patch) | |
| tree | 42364198d22a489fd99fa28df5fb53cd7703a077 /tools/include/linux/stacktrace.h | |
| parent | 128bb7fab342546352603bde8b49ff54e3af0529 (diff) | |
USB: lpc32xx_udc: Fix error handling in probe
lpc32xx_udc_probe() acquires an i2c_client reference through
isp1301_get_client() but fails to release it in both error handling
paths and the normal removal path. This could result in a reference
count leak for the I2C device, preventing proper cleanup and potentially
leading to resource exhaustion. Add put_device() to release the
reference in the probe failure path and in the remove function.
Calling path: isp1301_get_client() -> of_find_i2c_device_by_node() ->
i2c_find_device_by_fwnode(). As comments of i2c_find_device_by_fwnode()
says, 'The user must call put_device(&client->dev) once done with the
i2c client.'
Found by code review.
Cc: stable <stable@kernel.org>
Fixes: 24a28e428351 ("USB: gadget driver for LPC32xx")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Link: https://patch.msgid.link/20251215020931.15324-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/include/linux/stacktrace.h')
0 files changed, 0 insertions, 0 deletions
