Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset cf5cbac4 in mainline


Ignore:
Timestamp:
2018-01-09T17:01:49Z (4 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master
Children:
c386d6d
Parents:
c913f71e
Message:

xhci: check if endpoint is NULL before retrieving it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/endpoint.c

    rc913f71e rcf5cbac4  
    485485xhci_endpoint_t *xhci_device_get_endpoint(xhci_device_t *dev, usb_endpoint_t ep)
    486486{
    487         return xhci_endpoint_get(dev->base.endpoints[ep]);
     487        endpoint_t *ep_base = dev->base.endpoints[ep];
     488        if (!ep_base)
     489                return NULL;
     490
     491        return xhci_endpoint_get(ep_base);
    488492}
    489493
Note: See TracChangeset for help on using the changeset viewer.