Changeset 065064e6 in mainline for uspace/drv/bus/usb/usbhid/main.c


Ignore:
Timestamp:
2011-10-15T12:49:18Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e3f7418
Parents:
7c95d6f5
Message:

usb: Add and use usb_device_data_alloc.

Inspired by ddf_dev_data_alloc and ddf_fun_data_alloc.
Fix possible double free (hid dev and hid fun shared driver_data).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/main.c

    r7c95d6f5 r065064e6  
    7777        assert(dev != NULL);
    7878
    79         /*
    80          * Initialize device (get and process descriptors, get address, etc.)
    81          */
     79        /* Initialize device (get and process descriptors, get address, etc.) */
    8280        usb_log_debug("Initializing USB/HID device...\n");
    8381
    84         usb_hid_dev_t *hid_dev = usb_hid_new();
     82        usb_hid_dev_t *hid_dev =
     83            usb_device_data_alloc(dev, sizeof(usb_hid_dev_t));
    8584        if (hid_dev == NULL) {
    8685                usb_log_error("Error while creating USB/HID device "
Note: See TracChangeset for help on using the changeset viewer.