From: Beilei Xing Date: Fri, 19 Jul 2019 05:28:28 +0000 (+0800) Subject: net/ice: fix unsafe tailq element removal X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=eec6a3394e4a399d40916685f113bdec33a55704;p=dpdk.git net/ice: fix unsafe tailq element removal TAILQ_FOREACH macro is not safe to remove elements during iterating tailq lists. Replace it with TAILQ_FOREACH_SAFE. Fixes: d76116a4678f ("net/ice: add generic flow API") Signed-off-by: Beilei Xing Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 5725bff50e..1d07c83842 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "ice_ethdev.h" #include "ice_generic_flow.h" @@ -664,9 +665,10 @@ ice_flow_flush(struct rte_eth_dev *dev, { struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct rte_flow *p_flow; + void *temp; int ret = 0; - TAILQ_FOREACH(p_flow, &pf->flow_list, node) { + TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) { ret = ice_flow_destroy(dev, p_flow, error); if (ret) { rte_flow_error_set(error, -ret,