Changeset decfc8d1 in mainline for uspace/drv/bus/usb/xhci/hc.c
- Timestamp:
- 2017-08-20T18:52:03Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3d8a3bd
- Parents:
- 8b415cc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
r8b415cc rdecfc8d1 202 202 return ENOMEM; 203 203 204 hc->dcbaa_virt = malloc32((1 + hc->max_slots) * sizeof(xhci_ device_ctx_t*));204 hc->dcbaa_virt = malloc32((1 + hc->max_slots) * sizeof(xhci_virt_device_ctx_t)); 205 205 if (!hc->dcbaa_virt) { 206 206 err = ENOMEM; … … 507 507 /* Idx 0 already deallocated by xhci_scratchpad_free. */ 508 508 for (unsigned i = 1; i < hc->max_slots + 1; ++i) { 509 if (hc->dcbaa_virt[i]) { 510 if (hc->dcbaa_virt[i]->dev_ctx) 511 free32(hc->dcbaa_virt[i]->dev_ctx); 512 513 for (unsigned i = 0; i < XHCI_EP_COUNT; ++i) { 514 trb_ring = hc->dcbaa_virt[i]->trs[i]; 515 if (trb_ring) { 516 xhci_trb_ring_fini(trb_ring); 517 free32(trb_ring); 518 } 509 if (hc->dcbaa_virt[i].dev_ctx) { 510 free32(hc->dcbaa_virt[i].dev_ctx); 511 hc->dcbaa_virt[i].dev_ctx = NULL; 512 } 513 514 for (unsigned i = 0; i < XHCI_EP_COUNT; ++i) { 515 trb_ring = hc->dcbaa_virt[i].trs[i]; 516 if (trb_ring) { 517 hc->dcbaa_virt[i].trs[i] = NULL; 518 xhci_trb_ring_fini(trb_ring); 519 free32(trb_ring); 519 520 } 520 521 free32(hc->dcbaa_virt[i]);522 hc->dcbaa_virt[i] = NULL;523 521 } 524 522 }
Note:
See TracChangeset
for help on using the changeset viewer.