Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 47ab89e in mainline


Ignore:
Timestamp:
2017-10-25T13:56:30Z (3 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
master
Children:
f668d60
Parents:
3cbc138
Message:

trb ring: fix freeing segments

File:
1 edited

Legend:

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

    r3cbc138 r47ab89e  
    123123int xhci_trb_ring_fini(xhci_trb_ring_t *ring)
    124124{
    125         if (!ring)
    126                 return EOK;
    127 
    128         list_foreach(ring->segments, segments_link, trb_segment_t, segment)
     125        assert(ring);
     126
     127        list_foreach_safe(ring->segments, cur, next) {
     128                trb_segment_t *segment = list_get_instance(cur, trb_segment_t, segments_link);
    129129                dmamem_unmap_anonymous(segment);
     130        }
     131
    130132        return EOK;
    131133}
     
    293295int xhci_event_ring_fini(xhci_event_ring_t *ring)
    294296{
    295         list_foreach(ring->segments, segments_link, trb_segment_t, segment)
     297        list_foreach_safe(ring->segments, cur, next) {
     298                trb_segment_t *segment = list_get_instance(cur, trb_segment_t, segments_link);
    296299                dmamem_unmap_anonymous(segment);
     300        }
    297301
    298302        if (ring->erst)
Note: See TracChangeset for help on using the changeset viewer.