]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: chipidea: ci_hdrc_imx: decrement device's refcount in .remove() and in the error...
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Mon, 16 Dec 2024 01:55:39 +0000 (10:55 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:20 +0000 (12:50 +0100)
commit3f46fefab962fc5dcfe4d53a7c2cdccd51ebdc6d
tree26bf11deff67c5b66f105e2bc4d3065e7a423344
parent998b1fa6c2181106cce72dec7f8fe779192a8ebd
usb: chipidea: ci_hdrc_imx: decrement device's refcount in .remove() and in the error path of .probe()

[ Upstream commit 74adad500346fb07d69af2c79acbff4adb061134 ]

Current implementation of ci_hdrc_imx_driver does not decrement the
refcount of the device obtained in usbmisc_get_init_data(). Add a
put_device() call in .remove() and in .probe() before returning an
error.

This bug was found by an experimental static analysis tool that I am
developing.

Cc: stable <stable@kernel.org>
Fixes: f40017e0f332 ("chipidea: usbmisc_imx: Add USB support for VF610 SoCs")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20241216015539.352579-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/chipidea/ci_hdrc_imx.c