All of lore.kernel.org
 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, 01 Dec 2016 20:57:44 +0000	[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");

WARNING: multiple messages have this Message-ID (diff)
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:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-01 20:57 Dan Carpenter [this message]
2016-12-01 20:57 ` [patch] net: renesas: ravb: unintialized return value Dan Carpenter
2016-12-01 21:13 ` Sergei Shtylyov
2016-12-01 21:13   ` Sergei Shtylyov
2016-12-02  9:46 ` Johan Hovold
2016-12-02  9:46   ` Johan Hovold
2016-12-02 19:00 ` David Miller
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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.