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

Changeset 2582d8f in mainline


Ignore:
Timestamp:
2011-12-06T12:10:54Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
5cfcc64
Parents:
f167f55
Message:

libusbhost: Use same size for data copy and callback.

This breaks OHCI root hub driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/usb_transfer_batch.c

    rf167f55 r2582d8f  
    145145        if (instance->callback_in) {
    146146                /* We care about the data and there are some to copy */
     147                const size_t safe_size = min(size, instance->buffer_size);
    147148                if (data) {
    148                         const size_t minsize = min(size, instance->buffer_size);
    149                         memcpy(instance->buffer, data, minsize);
     149                        memcpy(instance->buffer, data, safe_size);
    150150                }
    151151                instance->callback_in(instance->fun, error,
    152                     instance->transfered_size, instance->arg);
     152                    safe_size, instance->arg);
    153153        }
    154154}
Note: See TracChangeset for help on using the changeset viewer.