]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: typec: fusb302: Fix resource leak when devm_drm_dp_hpd_bridge_add() fails
authorFelix Gu <ustc.gu@gmail.com>
Tue, 28 Apr 2026 13:18:21 +0000 (21:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 May 2026 14:40:54 +0000 (16:40 +0200)
commitca927fc45e4906bdab42426da044fba4d3584f34
treee2d28981ea7e2fefb37ec2e71308bffcb4261d05
parentc1a0ecbf32c4b397353204e2ec94c5bb9f3300ed
usb: typec: fusb302: Fix resource leak when devm_drm_dp_hpd_bridge_add() fails

If devm_drm_dp_hpd_bridge_add() fails during fusb302_probe(), the original
code returned directly without cleaning up the resources.

Move bridge registration before the IRQ is requested and route bridge
registration failures through the existing TCPM unregister and fwnode
cleanup path.

Fixes: 5d79c525405d ("usb: typec: fusb302: add DRM DP HPD bridge support")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patch.msgid.link/20260428-fusb-v2-1-aa3b5942cabb@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/fusb302.c