patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix an uninitialised variable
@ 2017-04-06  9:16 Nelio Laranjeiro
  2017-04-06 11:06 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Nelio Laranjeiro @ 2017-04-06  9:16 UTC (permalink / raw)
  To: dev, Ferruh Yigit; +Cc: Adrien Mazarguil, Olivier Matz, stable

Since patch "mbuf: structure reorganization" the compiler complains

 .../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 <nelio.laranjeiro@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 06b699a..fae9d27 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;
-- 
2.1.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] net/mlx5: fix an uninitialised variable
  2017-04-06  9:16 [dpdk-stable] [PATCH] net/mlx5: fix an uninitialised variable Nelio Laranjeiro
@ 2017-04-06 11:06 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2017-04-06 11:06 UTC (permalink / raw)
  To: Nelio Laranjeiro
  Cc: dev, Ferruh Yigit, Adrien Mazarguil, Olivier Matz, stable

2017-04-06 11:16, Nelio Laranjeiro:
> Since patch "mbuf: structure reorganization" the compiler complains
> 
>  .../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 <nelio.laranjeiro@6wind.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks

It is important to note that we see this error only after the mbuf rework
of 17.05, only with GCC, and only when debug is enabled.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-06 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06  9:16 [dpdk-stable] [PATCH] net/mlx5: fix an uninitialised variable Nelio Laranjeiro
2017-04-06 11:06 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).