[dpdk-dev] [PATCH v2 2/5] net/ice: fix dereference after null check coverity

Xiao Zhang xiao.zhang at intel.com
Tue Aug 6 01:20:51 CEST 2019


This patch fixes (dereference after null check) coverity issue.
The address of first segmented packets was not set correctly during
reassembling packets which led to this issue.

Coverity issue: 343452
Coverity issue: 343407
Fixes: c68a52b8 ("net/ice: support vector SSE in Rx")
Cc: stable at dpdk.org

Signed-off-by: Xiao Zhang <xiao.zhang at intel.com>
---
 drivers/net/ice/ice_rxtx_vec_avx2.c | 1 +
 drivers/net/ice/ice_rxtx_vec_sse.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ice/ice_rxtx_vec_avx2.c b/drivers/net/ice/ice_rxtx_vec_avx2.c
index fac869a..5ce29c2 100644
--- a/drivers/net/ice/ice_rxtx_vec_avx2.c
+++ b/drivers/net/ice/ice_rxtx_vec_avx2.c
@@ -656,6 +656,7 @@ ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 			i++;
 		if (i == nb_bufs)
 			return nb_bufs;
+		rxq->pkt_first_seg = rx_pkts[i];
 	}
 	return i + ice_rx_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
 					     &split_flags[i]);
diff --git a/drivers/net/ice/ice_rxtx_vec_sse.c b/drivers/net/ice/ice_rxtx_vec_sse.c
index 049f60d..967a7b1 100644
--- a/drivers/net/ice/ice_rxtx_vec_sse.c
+++ b/drivers/net/ice/ice_rxtx_vec_sse.c
@@ -509,6 +509,7 @@ ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 			i++;
 		if (i == nb_bufs)
 			return nb_bufs;
+		rxq->pkt_first_seg = rx_pkts[i];
 	}
 	return i + ice_rx_reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
 					     &split_flags[i]);
-- 
2.7.4



More information about the dev mailing list