From: Nelio Laranjeiro Date: Thu, 6 Apr 2017 09:16:32 +0000 (+0200) Subject: net/mlx5: fix an uninitialized variable X-Git-Tag: spdx-start~3758 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4e66a6fef321d8015f6bde1aac5018c9ec91721c;p=dpdk.git net/mlx5: fix an uninitialized variable Since patch "mbuf: structure reorganization" the compiler complains sometimes (in some conditions): .../drivers/net/mlx5/mlx5_rxtx.c: In function ‘mlx5_rx_burst’: .../drivers/net/mlx5/mlx5_rxtx.c:2082:17: error: ‘len’ may be used uninitialized in this function [-Werror=maybe-uninitialized] len is not initialised as it will be at the first segment of a received packet, but it remains hard for the compiler to determine it. Fixes: 9964b965ad69 ("net/mlx5: re-add Rx scatter support") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro Acked-by: Olivier Matz --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 06b699afa0..fae9d27165 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -1972,7 +1972,7 @@ mlx5_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) &(*rxq->cqes)[rxq->cq_ci & cqe_cnt]; unsigned int i = 0; unsigned int rq_ci = rxq->rq_ci << sges_n; - int len; /* keep its value across iterations. */ + int len = 0; /* keep its value across iterations. */ while (pkts_n) { unsigned int idx = rq_ci & wqe_cnt;