Changes in uspace/drv/bus/usb/usbmast/main.c [5f6e25e:d6c953e9] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/main.c
r5f6e25e rd6c953e9 94 94 95 95 /* Allocate softstate */ 96 mdev = calloc(1, sizeof(usbmast_dev_t));96 mdev = ddf_dev_data_alloc(dev->ddf_dev, sizeof(usbmast_dev_t)); 97 97 if (mdev == NULL) { 98 98 usb_log_error("Failed allocating softstate.\n"); 99 rc = ENOMEM; 100 goto error; 99 return ENOMEM; 101 100 } 102 101 … … 125 124 error: 126 125 /* XXX Destroy functions */ 127 if (mdev != NULL)128 free(mdev);129 126 return rc; 130 127 } … … 158 155 } 159 156 160 free(fun_name);161 162 157 /* Allocate soft state */ 163 mfun = ddf_ dev_data_alloc(mdev->ddf_dev, sizeof(usbmast_fun_t));158 mfun = ddf_fun_data_alloc(fun, sizeof(usbmast_fun_t)); 164 159 if (mfun == NULL) { 165 160 usb_log_error("Failed allocating softstate.\n"); … … 171 166 mfun->lun = lun; 172 167 173 fun_name = NULL;174 175 168 /* Set up a connection handler. */ 176 169 fun->conn_handler = usbmast_bd_connection; 177 fun->driver_data = mfun;178 170 179 171 usb_log_debug("Inquire...\n"); … … 219 211 goto error; 220 212 } 213 214 free(fun_name); 221 215 222 216 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.