Changes in uspace/drv/bus/usb/vhc/hub/virthub.c [58563585:33b8d024] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/hub/virthub.c
r58563585 r33b8d024 42 42 #include <stdio.h> 43 43 #include <stdlib.h> 44 #include <str.h> 44 45 #include <ddf/driver.h> 45 46 … … 147 148 * @return Error code. 148 149 */ 149 int virthub_init(usbvirt_device_t *dev, const char* name)150 errno_t virthub_init(usbvirt_device_t *dev, const char* name) 150 151 { 151 152 if (dev == NULL) { … … 155 156 dev->descriptors = &descriptors; 156 157 dev->address = 0; 157 dev->name = str_dup(name); 158 if (!dev->name) 158 159 char *n = str_dup(name); 160 if (!n) 159 161 return ENOMEM; 160 162 161 163 hub_t *hub = malloc(sizeof(hub_t)); 162 164 if (hub == NULL) { 163 free( dev->name);165 free(n); 164 166 return ENOMEM; 165 167 } 166 168 169 dev->name = n; 167 170 hub_init(hub); 168 171 dev->device_data = hub; … … 197 200 * @return Error code. 198 201 */ 199 int virthub_disconnect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn)202 errno_t virthub_disconnect_device(usbvirt_device_t *dev, vhc_virtdev_t *conn) 200 203 { 201 204 assert(dev != NULL);
Note:
See TracChangeset
for help on using the changeset viewer.