]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: typec: tcpci_rt1711h: unregister TCPCI port with devres
authorMyeonghun Pak <mhun512@gmail.com>
Mon, 6 Jul 2026 14:53:12 +0000 (23:53 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jul 2026 11:55:59 +0000 (13:55 +0200)
commite8da46d99d3710106e7c44db14566bf9b57386b5
treebe3996b17445cf41a3862167c1df9612b4ff4700
parent9cff680e47632b7723cb19f9c5e63669063c3417
usb: typec: tcpci_rt1711h: unregister TCPCI port with devres

rt1711h_probe() registers the TCPCI port before requesting the interrupt
and enabling alert interrupts. If either of those later steps fails, the
probe function returns without unregistering the TCPCI port. The explicit
unregister currently only happens from the remove callback.

Register a devres action immediately after tcpci_register_port() succeeds,
so tcpci_unregister_port() runs on later probe failures and on driver
detach. Drop the remove callback to avoid unregistering the same port
twice.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: 302c570bf36e ("usb: typec: tcpci_rt1711h: avoid screaming irq causing boot hangs")
Cc: stable <stable@kernel.org>
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Link: https://patch.msgid.link/20260706145312.37260-1-mhun512@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpci_rt1711h.c