Changeset 065064e6 in mainline for uspace/drv/bus/usb/usbmast/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/usbmast/main.c

    r7c95d6f5 r065064e6  
    103103        }
    104104        free(mdev->luns);
    105         free(mdev);
    106105        return EOK;
    107106}
     
    119118
    120119        /* Allocate softstate */
    121         dev->driver_data = mdev = malloc(sizeof(usbmast_dev_t));
     120        mdev = usb_device_data_alloc(dev, sizeof(usbmast_dev_t));
    122121        if (mdev == NULL) {
    123122                usb_log_error("Failed allocating softstate.\n");
Note: See TracChangeset for help on using the changeset viewer.