Changeset c83a55c in mainline for uspace/lib/usbdev/src/altiface.c
- Timestamp:
- 2011-10-31T06:52:54Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c25e39b
- Parents:
- e8ab32f (diff), 3ce78580 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/altiface.c
re8ab32f rc83a55c 98 98 assert(config_descr_size > 0); 99 99 100 *alternates_ptr = NULL; 100 101 if (interface_number < 0) { 101 alternates_ptr = NULL;102 102 return EOK; 103 103 } … … 105 105 usb_alternate_interfaces_t *alternates 106 106 = malloc(sizeof(usb_alternate_interfaces_t)); 107 108 107 if (alternates == NULL) { 109 108 return ENOMEM; … … 119 118 } 120 119 121 alternates->alternatives = malloc(alternates->alternative_count122 *sizeof(usb_alternate_interface_descriptors_t));120 alternates->alternatives = calloc(alternates->alternative_count, 121 sizeof(usb_alternate_interface_descriptors_t)); 123 122 if (alternates->alternatives == NULL) { 124 123 free(alternates); … … 176 175 } 177 176 178 177 void usb_alternate_interfaces_destroy(usb_alternate_interfaces_t *alternate) 178 { 179 if (!alternate) 180 return; 181 free(alternate->alternatives); 182 free(alternate); 183 } 179 184 /** 180 185 * @}
Note:
See TracChangeset
for help on using the changeset viewer.