Changeset c05642d in mainline for uspace/drv/bus/usb/usbmast/main.c


Ignore:
Timestamp:
2011-09-07T00:03:26Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5081276
Parents:
bb74dabe (diff), 038b289 (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 mainline changes.

File:
1 edited

Legend:

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

    rbb74dabe rc05642d  
    145145        usbmast_fun_t *mfun = NULL;
    146146
    147         /* Allocate softstate */
    148         mfun = calloc(1, sizeof(usbmast_fun_t));
    149         if (mfun == NULL) {
    150                 usb_log_error("Failed allocating softstate.\n");
    151                 rc = ENOMEM;
    152                 goto error;
    153         }
    154 
    155         mfun->mdev = mdev;
    156         mfun->lun = lun;
    157 
    158147        if (asprintf(&fun_name, "l%u", lun) < 0) {
    159148                usb_log_error("Out of memory.\n");
     
    170159
    171160        free(fun_name);
     161
     162        /* Allocate soft state */
     163        mfun = ddf_dev_data_alloc(mdev->ddf_dev, sizeof(usbmast_fun_t));
     164        if (mfun == NULL) {
     165                usb_log_error("Failed allocating softstate.\n");
     166                rc = ENOMEM;
     167                goto error;
     168        }
     169
     170        mfun->mdev = mdev;
     171        mfun->lun = lun;
     172
    172173        fun_name = NULL;
    173174
     
    227228        if (fun_name != NULL)
    228229                free(fun_name);
    229         if (mfun != NULL)
    230                 free(mfun);
    231230        return rc;
    232231}
Note: See TracChangeset for help on using the changeset viewer.