net/ice: fix address of first segment
authorXiao Zhang <xiao.zhang@intel.com>
Mon, 5 Aug 2019 23:20:51 +0000 (07:20 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 6 Aug 2019 11:29:25 +0000 (13:29 +0200)
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 <xiao.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/ice_rxtx_vec_avx2.c
drivers/net/ice/ice_rxtx_vec_sse.c

index fac869a..5ce29c2 100644 (file)
@@ -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]);
index 049f60d..967a7b1 100644 (file)
@@ -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]);