]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: typec: anx7411: fix fwnode_handle reference leak
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Thu, 21 Nov 2024 02:34:29 +0000 (11:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Dec 2024 17:13:05 +0000 (18:13 +0100)
commitf4911ecc0034b0fcde3ac160af99231cb3b5e43d
tree11dbd609c8e62d8b0aff2f77ad94ee77515ee09e
parent0967e8e734b8d2de9b9d9d2450527cdd76d4d204
usb: typec: anx7411: fix fwnode_handle reference leak

commit 645d56e4cc74e953284809d096532c1955918a28 upstream.

An fwnode_handle and usb_role_switch are obtained with an incremented
refcount in anx7411_typec_port_probe(), however the refcounts are not
decremented in the error path. The fwnode_handle is also not decremented
in the .remove() function. Therefore, call fwnode_handle_put() and
usb_role_switch_put() accordingly.

Fixes: fe6d8a9c8e64 ("usb: typec: anx7411: Add Analogix PD ANX7411 support")
Cc: stable@vger.kernel.org
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20241121023429.962848-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/anx7411.c