Re: usbcore: NULL pointer dereference after detaching USB disk with linux 4.17

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11.05.2018 23:06, Jordan Glover wrote:
On May 11, 2018 6:14 PM, Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx> wrote:

I think that just adding the below code should be enough for 4.17

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c

index 72ebbc9..32cd52c 100644

--- a/drivers/usb/host/xhci-hub.c

+++ b/drivers/usb/host/xhci-hub.c

@@ -354,7 +354,7 @@ int xhci_find_slot_id_by_port(struct usb_hcd *hcd, struct xhci_hcd *xhci,

slot_id = 0;

for (i = 0; i < MAX_HC_SLOTS; i++) {

-                 if (!xhci->devs[i])
-                 if (!xhci->devs[i] || !xhci->devs[i]->udev)
continue;
                    speed = xhci->devs[i]->udev->speed;
if (((speed >= USB_SPEED_SUPER) == (hcd->speed >= HCD_USB3))
-Mathias

I can confirm that above patch fixes this. I saw that offending commit was
backported to 4.16.8 so it needs this fix as well. Thank you.
​

Thanks, sent patch.
Added stable tags and Reported-by/Tested-by: tags

-Mathias

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux