]> git.baikalelectronics.ru Git - kernel.git/commit
xhci: Fix null pointer dereference in remove if xHC has only one roothub
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 25 Aug 2022 15:08:38 +0000 (18:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 15:48:30 +0000 (17:48 +0200)
commitc413005f93b69016c52489a2d5fc046b25c1fa80
treeaa50e3ff5c8bc2983e419df22b09d1432c9902e9
parent7440039249f5760f8bf5ab74c9eb7783fab40903
xhci: Fix null pointer dereference in remove if xHC has only one roothub

The remove path in xhci platform driver tries to remove and put both main
and shared hcds even if only a main hcd exists (one roothub)

This causes a null pointer dereference in reboot for those controllers.

Check that the shared_hcd exists before trying to remove it.

Fixes: 12d22f7d7e88 ("usb: host: xhci-plat: prepare operation w/o shared hcd")
Reported-by: Alexey Sheplyakov <asheplyakov@basealt.ru>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220825150840.132216-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-plat.c