]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Fix NULL pointer dereference in xhci_clear_tt_buffer_complete()
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 4 Oct 2019 11:59:33 +0000 (14:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2019 12:32:12 +0000 (14:32 +0200)
commit9bfd4153b43a3f68348d1266ddd66cea2957dd24
tree9d1026266cf639881ec85127cc7a4585a239d85a
parent7218bdc88a6a1b1c127199c9c87644f3be7312fa
xhci: Fix NULL pointer dereference in xhci_clear_tt_buffer_complete()

udev stored in ep->hcpriv might be NULL if tt buffer is cleared
due to a halted control endpoint during device enumeration

xhci_clear_tt_buffer_complete is called by hub_tt_work() once it's
scheduled,  and by then usb core might have freed and allocated a
new udev for the next enumeration attempt.

Fixes: aa5283a3ff71 ("usb: xhci: Add Clear_TT_Buffer")
Cc: <stable@vger.kernel.org> # v5.3
Reported-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/1570190373-30684-9-git-send-email-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c