xhci: guard accesses to ep_state in xhci_endpoint_reset()
authorJonathan Bell <jonathan@raspberrypi.com>
Fri, 8 Oct 2021 09:25:43 +0000 (12:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:45:00 +0000 (11:45 +0200)
commitdc3e0a20dbb9dbaa22f4a33dea34230f8c663c40
tree4d07b0990eddff5a287ab8dc5716cbf2224e7e70
parent0ee66290f00602d91413a3779b0f5ee7e7dd51d9
xhci: guard accesses to ep_state in xhci_endpoint_reset()

commit a01ba2a3378be85538e0183ae5367c1bc1d5aaf3 upstream.

See https://github.com/raspberrypi/linux/issues/3981

Two read-modify-write cycles on ep->ep_state are not guarded by
xhci->lock. Fix these.

Fixes: f5249461b504 ("xhci: Clear the host side toggle manually when endpoint is soft reset")
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20211008092547.3996295-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c