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