Merge "usb: xhci: Avoid NULL pointer access of sec event ring"

This commit is contained in:
qctecmdr 2021-09-11 05:15:34 -07:00 • committed by Gerrit - the friendly Code Review server
commit 16c10b79ca

View file

@ -1923,6 +1923,11 @@ static int sec_event_ring_cleanup(struct xhci_hcd *xhci, unsigned int intr_num)
return -EINVAL;
}
if (!xhci->sec_erst) {
xhci_err(xhci, "secondary ring is NULL or not initialized\n");
return -EINVAL;
}
size =
sizeof(struct xhci_erst_entry)*(xhci->sec_erst[intr_num].num_entries);
if (xhci->sec_erst[intr_num].entries) {