]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: xhci: prevent potential failure in handle_tx_event() for Transfer events without TRB
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Mon, 29 Apr 2024 14:02:37 +0000 (17:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jul 2024 10:49:06 +0000 (12:49 +0200)
commit9a24eb8010c2dc6a2eba56e3eb9fc07d14ffe00a
treeeff6538fb30a58ffa6474253ff81f1a68033720b
parentc727e46f0cc8bd81788bb29dac9a0a45f2dfa2eb
usb: xhci: prevent potential failure in handle_tx_event() for Transfer events without TRB

[ Upstream commit 66cb618bf0bb82859875b00eeffaf223557cb416 ]

Some transfer events don't always point to a TRB, and consequently don't
have a endpoint ring. In these cases, function handle_tx_event() should
not proceed, because if 'ep->skip' is set, the pointer to the endpoint
ring is used.

To prevent a potential failure and make the code logical, return after
checking the completion code for a Transfer event without TRBs.

Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240429140245.3955523-11-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/xhci-ring.c