diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index 9e6d746f8f33..82dfbbc64ce2 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -750,7 +750,7 @@ void cds_drop_rxpkt_by_staid(p_cds_sched_context pSchedContext, uint16_t staId) } spin_unlock_bh(&pSchedContext->ol_rx_queue_lock); - list_for_each_entry(pkt, &local_list, list) { + list_for_each_entry_safe(pkt, tmp, &local_list, list) { list_del(&pkt->list); buf = pkt->Rxpkt; while (buf) {