Unverified Commit 36427360 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11066 xhci: Fix null pointer dereference when host dies

parents 0ef53bb1 b37cfa29
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3913,6 +3913,7 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
	struct xhci_virt_device *virt_dev;
	struct xhci_slot_ctx *slot_ctx;
	unsigned long flags;
	int i, ret;

	/*
@@ -3941,7 +3942,11 @@ static void xhci_free_dev(struct usb_hcd *hcd, struct usb_device *udev)
	}
	virt_dev->udev = NULL;
	xhci_disable_slot(xhci, udev->slot_id);

	spin_lock_irqsave(&xhci->lock, flags);
	xhci_free_virt_device(xhci, udev->slot_id);
	spin_unlock_irqrestore(&xhci->lock, flags);

}

int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id)