Changeset 831aa466 in mainline for uspace/drv/bus/usb/xhci/endpoint.c


Ignore:
Timestamp:
2018-06-26T23:16:12Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2fc9bfd
Parents:
70fae4e
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-26 23:06:11)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-26 23:16:12)
Message:

Fix cases of undefined behavior found by ubsan.

File:
1 edited

Legend:

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

    r70fae4e r831aa466  
    102102        if (dev->speed >= USB_SPEED_HIGH ||
    103103            ep->transfer_type != USB_TRANSFER_INTERRUPT) {
    104                 xhci_ep->interval = 1 << (xhci_ep->interval - 1);
     104
     105                if (xhci_ep->interval > 0)
     106                        xhci_ep->interval = 1 << (xhci_ep->interval - 1);
    105107        }
    106108
Note: See TracChangeset for help on using the changeset viewer.