linux/drivers/net/mctp
Johan Hovold 3224990fb1 net: mctp: fix device leak on probe failure
commit 224a0d284c upstream.

Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

This driver takes a reference to the USB device during probe but does
not to release it on probe failures.

Drop the redundant device reference to fix the leak, reduce cargo
culting, make it easier to spot drivers where an extra reference is
needed, and reduce the risk of further memory leaks.

Fixes: 0791c0327a ("net: mctp: Add MCTP USB transport driver")
Cc: stable@vger.kernel.org	# 6.15
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://patch.msgid.link/20260305104549.16110-1-johan@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-03-19 16:08:40 +01:00
..
Kconfig net: mctp: Add MCTP USB transport driver 2025-02-21 16:45:21 -08:00
Makefile net: mctp: Add MCTP USB transport driver 2025-02-21 16:45:21 -08:00
mctp-i2c.c mctp: i2c: fix skb memory leak in receive path 2026-03-19 16:08:16 +01:00
mctp-i3c.c net: mctp i3c: Copy headers if cloned 2025-03-07 19:41:10 -08:00
mctp-serial.c net: mctp: Expose transport binding identifier via IFLA attribute 2024-11-09 09:04:54 -08:00
mctp-usb.c net: mctp: fix device leak on probe failure 2026-03-19 16:08:40 +01:00