Changeset 4046c1ea in mainline for uspace/drv/uhci/callback.c


Ignore:
Timestamp:
2011-01-29T00:14:07Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1431e8f
Parents:
b3258ad (diff), 44d8853 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge parent branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/callback.c

    rb3258ad r4046c1ea  
    99        assert(instance);
    1010        assert(func_in == NULL || func_out == NULL);
    11         instance->new_buffer = malloc32(size);
    12         if (!instance->new_buffer) {
    13                 uhci_print_error("Failed to allocate device acessible buffer.\n");
    14                 return ENOMEM;
     11        if (size > 0) {
     12                instance->new_buffer = malloc32(size);
     13                if (!instance->new_buffer) {
     14                        uhci_print_error("Failed to allocate device acessible buffer.\n");
     15                        return ENOMEM;
     16                }
     17                if (func_out)
     18                        memcpy(instance->new_buffer, buffer, size);
     19        } else {
     20                instance->new_buffer = NULL;
    1521        }
    1622
    17         if (func_out)
    18                 memcpy(instance->new_buffer, buffer, size);
    1923
    2024        instance->callback_out = func_out;
Note: See TracChangeset for help on using the changeset viewer.