netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Johan Hovold <johan@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Yoshihiro Kaneko" <ykaneko0929@gmail.com>,
	"Kazuya Mizuguchi" <kazuya.mizuguchi.ks@renesas.com>,
	"Simon Horman" <horms+renesas@verge.net.au>,
	"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Philippe Reynes" <tremyfr@gmail.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"Arnd Bergmann" <arnd@arndb.de>,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [patch] net: renesas: ravb: unintialized return value
Date: Thu, 1 Dec 2016 23:57:44 +0300	[thread overview]
Message-ID: <20161201205744.GB10701@mwanda> (raw)

We want to set the other "err" variable here so that we can return it
later.  My version of GCC misses this issue but I caught it with a
static checker.

Fixes: 9f70eb339f52 ("net: ethernet: renesas: ravb: fix fixed-link phydev leaks")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Applies to the net tree for 4.10.

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 2c0357c..92d7692 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1016,8 +1016,6 @@ static int ravb_phy_init(struct net_device *ndev)
 	 * at this time.
 	 */
 	if (priv->chip_id == RCAR_GEN3) {
-		int err;
-
 		err = phy_set_max_speed(phydev, SPEED_100);
 		if (err) {
 			netdev_err(ndev, "failed to limit PHY to 100Mbit/s\n");

             reply	other threads:[~2016-12-01 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 20:57 Dan Carpenter [this message]
2016-12-01 21:13 ` [patch] net: renesas: ravb: unintialized return value Sergei Shtylyov
2016-12-02  9:46 ` Johan Hovold
2016-12-02 19:00 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161201205744.GB10701@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=horms+renesas@verge.net.au \
    --cc=johan@kernel.org \
    --cc=kazuya.mizuguchi.ks@renesas.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=tremyfr@gmail.com \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=ykaneko0929@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).