From 91342addd15fdfe47273feb784ab58c48609098a Mon Sep 17 00:00:00 2001 From: Xiao Zhang Date: Tue, 6 Aug 2019 07:20:51 +0800 Subject: [PATCH] net/ice: 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: 343452, 343407 Fixes: c68a52b8b38c ("net/ice: support vector SSE in Rx") Cc: stable@dpdk.org Signed-off-by: Xiao Zhang Acked-by: Xiaolong Ye --- 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 fac869a420..5ce29c2a25 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 049f60d43b..967a7b16b1 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.20.1