DM USB: xHCI: fix potential NULL pointer issue.

During S3 process, the dev in the function pci_xhci_device_doorbell
may be set to NULL when disconnection is detected by DM. This patch
is used to remove this risk.

Tracked-On: #1893
Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Xiaoguang Wu 2018-11-20 16:14:17 +08:00 committed by wenlingz
parent 5b39fd0ed3
commit 966c587260

View File

@ -2937,6 +2937,9 @@ pci_xhci_device_doorbell(struct pci_xhci_vdev *xdev,
}
dev = XHCI_SLOTDEV_PTR(xdev, slot);
if (!dev)
return;
devep = &dev->eps[epid];
dev_ctx = pci_xhci_get_dev_ctx(xdev, slot);
if (!dev_ctx)