Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1368026 > unrolled thread

[PATCH] net: mvpp2: fix maybe-uninitialized warning

Started byJisheng Zhang <jszhang@marvell.com>
First post2016-03-31 11:10 +0200
Last post2016-04-01 20:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: mvpp2: fix maybe-uninitialized warning Jisheng Zhang <jszhang@marvell.com> - 2016-03-31 11:10 +0200
    Re: [PATCH] net: mvpp2: fix maybe-uninitialized warning David Miller <davem@davemloft.net> - 2016-04-01 20:40 +0200

#1368026 — [PATCH] net: mvpp2: fix maybe-uninitialized warning

FromJisheng Zhang <jszhang@marvell.com>
Date2016-03-31 11:10 +0200
Subject[PATCH] net: mvpp2: fix maybe-uninitialized warning
Message-ID<riGM2-2Es-9@gated-at.bofh.it>
This is to fix the following maybe-uninitialized warning:

drivers/net/ethernet/marvell/mvpp2.c:6007:18: warning: 'err' may be
used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index c797971a..e9aa8d9 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -6059,8 +6059,10 @@ static int mvpp2_port_init(struct mvpp2_port *port)
 
 		/* Map physical Rx queue to port's logical Rx queue */
 		rxq = devm_kzalloc(dev, sizeof(*rxq), GFP_KERNEL);
-		if (!rxq)
+		if (!rxq) {
+			err = -ENOMEM;
 			goto err_free_percpu;
+		}
 		/* Map this Rx queue to a physical queue */
 		rxq->id = port->first_rxq + queue;
 		rxq->port = port->id;
-- 
2.8.0.rc3

[toc] | [next] | [standalone]


#1369515

FromDavid Miller <davem@davemloft.net>
Date2016-04-01 20:40 +0200
Message-ID<rjc9c-8p1-11@gated-at.bofh.it>
In reply to#1368026
From: Jisheng Zhang <jszhang@marvell.com>
Date: Thu, 31 Mar 2016 17:01:23 +0800

> This is to fix the following maybe-uninitialized warning:
> 
> drivers/net/ethernet/marvell/mvpp2.c:6007:18: warning: 'err' may be
> used uninitialized in this function [-Wmaybe-uninitialized]
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web