From: Xiao Zhang Date: Mon, 5 Aug 2019 23:20:52 +0000 (+0800) Subject: net/i40e: fix address of first segment X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4916f63985ddb56af43980252d1134d051523685;p=dpdk.git net/i40e: fix address of first segment 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, 343403 Fixes: ca74903b75cf ("net/i40e: extract non-x86 specific code from vector driver") Cc: stable@dpdk.org Signed-off-by: Xiao Zhang Acked-by: Xiaolong Ye --- diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c index c4dc990e0c..6f3278960f 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 3b22588c5a..1fc66b781a 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]);