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

Xiao Zhang xiao.zhang at intel.com
Tue Aug 6 01:20:52 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: 343422
Coverity issue: 343403
Fixes: ca74903b ("net/i40e: extract non-x86 specific code from vector
driver")
Cc: stable at dpdk.org

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

diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index c4dc990..6f32789 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -590,6 +590,7 @@ i40e_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 + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
 		&split_flags[i]);
diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 3b22588..1fc66b7 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -506,6 +506,7 @@ i40e_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 + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,
 		&split_flags[i]);
-- 
2.7.4



More information about the dev mailing list