summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Zhang <xiao.zhang@intel.com>2019-08-06 07:20:52 +0800
committerKevin Traynor <ktraynor@redhat.com>2019-09-13 10:37:20 +0100
commit6b012183b8381fa92f309bd553e2e51e58c00d41 (patch)
treed3a0076cceb77c7102f8ae33c8eef662791173cb
parent08302ebe6fd695b8fd5ceb62b7f6ab21a85e3761 (diff)
downloaddpdk-stable-6b012183b8381fa92f309bd553e2e51e58c00d41.zip
dpdk-stable-6b012183b8381fa92f309bd553e2e51e58c00d41.tar.gz
dpdk-stable-6b012183b8381fa92f309bd553e2e51e58c00d41.tar.xz
net/i40e: fix address of first segment
[ upstream commit 4916f63985ddb56af43980252d1134d051523685 ] 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") Signed-off-by: Xiao Zhang <xiao.zhang@intel.com> Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
-rw-r--r--drivers/net/i40e/i40e_rxtx_vec_avx2.c1
-rw-r--r--drivers/net/i40e/i40e_rxtx_vec_sse.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/i40e/i40e_rxtx_vec_avx2.c b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
index 23179b3..472f2e2 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_avx2.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_avx2.c
@@ -619,6 +619,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]);