Changeset 3256a6c in mainline


Ignore:
Timestamp:
2017-07-09T18:10:15Z (7 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
afa347e
Parents:
b19131c5
Message:

Added deallocation of dcbaa and device contexts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/hc.c

    rb19131c5 r3256a6c  
    401401        }
    402402
    403         /* Update the ERDP to make room inthe ring */
     403        /* Update the ERDP to make room in the ring */
    404404        uint64_t erstptr = addr_to_phys(hc->event_ring.erst);
    405405        XHCI_REG_WR(intr, XHCI_INTR_ERDP_LO, LOWER32(erstptr));
     
    433433}
    434434
     435static void hc_dcbaa_fini(xhci_hc_t *hc)
     436{
     437        xhci_scratchpad_free(hc);
     438
     439        /**
     440         * Idx 0 already deallocated by xhci_scratchpad_free.
     441         */
     442        for (int i = 1; i < hc->max_slots + 1; ++i) {
     443                if (hc->dcbaa[i] != NULL) {
     444                        free32(hc->dcbaa[i]);
     445                        hc->dcbaa[i] = NULL;
     446                }
     447        }
     448
     449        free32(hc->dcbaa);
     450}
     451
    435452void hc_fini(xhci_hc_t *hc)
    436453{
    437454        xhci_trb_ring_fini(&hc->command_ring);
    438455        xhci_event_ring_fini(&hc->event_ring);
    439         xhci_scratchpad_free(hc);
     456        hc_dcbaa_fini(hc);
    440457        pio_disable(hc->base, RNGSZ(hc->mmio_range));
    441458        usb_log_info("HC(%p): Finalized.", hc);
Note: See TracChangeset for help on using the changeset viewer.