It could be a potential not safe issue.
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Jing Chen <jing.d.chen@intel.com>
if (q) {
PMD_INIT_LOG(DEBUG, "Freeing rx queue %p", q);
rx_queue_clean(q);
- if (q->sw_ring)
+ if (q->sw_ring) {
rte_free(q->sw_ring);
+ q->sw_ring = NULL;
+ }
rte_free(q);
+ q = NULL;
}
}
if (q) {
PMD_INIT_LOG(DEBUG, "Freeing tx queue %p", q);
tx_queue_clean(q);
- if (q->rs_tracker.list)
+ if (q->rs_tracker.list) {
rte_free(q->rs_tracker.list);
- if (q->sw_ring)
+ q->rs_tracker.list = NULL;
+ }
+ if (q->sw_ring) {
rte_free(q->sw_ring);
+ q->sw_ring = NULL;
+ }
rte_free(q);
+ q = NULL;
}
}