Changeset 73e5b62 in mainline for uspace/drv/bus/usb/xhci/hc.c
- Timestamp:
- 2017-07-31T19:58:08Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7428b92
- Parents:
- c9bec1c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
rc9bec1c r73e5b62 198 198 int err; 199 199 200 hc->dcbaa = malloc32((1 + hc->max_slots) * sizeof( xhci_device_ctx_t*));200 hc->dcbaa = malloc32((1 + hc->max_slots) * sizeof(uint64_t)); 201 201 if (!hc->dcbaa) 202 202 return ENOMEM; 203 203 204 hc->dcbaa_virt = malloc32((1 + hc->max_slots) * sizeof(xhci_device_ctx_t*)); 205 if (!hc->dcbaa_virt) { 206 err = ENOMEM; 207 goto err_dcbaa; 208 } 209 204 210 if ((err = xhci_trb_ring_init(&hc->command_ring, hc))) 205 goto err_dcbaa ;211 goto err_dcbaa_virt; 206 212 207 213 if ((err = xhci_event_ring_init(&hc->event_ring, hc))) … … 220 226 err_cmd_ring: 221 227 xhci_trb_ring_fini(&hc->command_ring); 228 err_dcbaa_virt: 229 free32(hc->dcbaa_virt); 222 230 err_dcbaa: 223 231 free32(hc->dcbaa); … … 468 476 /* Idx 0 already deallocated by xhci_scratchpad_free. */ 469 477 for (unsigned i = 1; i < hc->max_slots + 1; ++i) { 470 if (hc->dcbaa [i] != NULL) {471 free32(hc->dcbaa [i]);472 hc->dcbaa [i] = NULL;478 if (hc->dcbaa_virt[i] != NULL) { 479 free32(hc->dcbaa_virt[i]); 480 hc->dcbaa_virt[i] = NULL; 473 481 } 474 482 } 475 483 476 484 free32(hc->dcbaa); 485 free32(hc->dcbaa_virt); 477 486 } 478 487
Note:
See TracChangeset
for help on using the changeset viewer.