usb: xhci: Avoid NULL pointer access of sec event ring
Consider a case where DUT is in a low memory condition and
it is switching between host and none frequently. This can
lead the driver to fail the allocation of primary event ring
and go into error path where it will try to cleanup the event
ring. Since secondary event ring was not even initialized, while
fetching the entries to cleanup, it will lead to NULL pointer
dereference.
Avoid this by adding a NULL check for secondary event ring before
fetching the entries and bailing out early from cleanup function.
Change-Id: I21488d0e0a02347a392d890918c5c874b704795f
Signed-off-by:
Pratham Pratap <prathampratap@codeaurora.org>
Loading
Please register or sign in to comment