[net-next] phylink: Fix an uninitialized variable bug
diff mbox

Message ID 20170809213550.rga6tlohagu2pm2y@mwanda
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Dan Carpenter Aug. 9, 2017, 9:35 p.m. UTC
"ret" isn't necessarily initialized here.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Andrew Lunn Aug. 10, 2017, 3:21 p.m. UTC | #1
On Thu, Aug 10, 2017 at 12:35:50AM +0300, Dan Carpenter wrote:
> "ret" isn't necessarily initialized here.
> 
> Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
David Miller Aug. 11, 2017, 8:58 p.m. UTC | #2
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 10 Aug 2017 00:35:50 +0300

> "ret" isn't necessarily initialized here.
> 
> Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks Dan.
Russell King - ARM Linux admin Aug. 17, 2017, 9:02 a.m. UTC | #3
On Thu, Aug 10, 2017 at 05:21:12PM +0200, Andrew Lunn wrote:
> On Thu, Aug 10, 2017 at 12:35:50AM +0300, Dan Carpenter wrote:
> > "ret" isn't necessarily initialized here.
> > 
> > Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Thanks, not sure how that got missed - it was probably introduced when
migrating the code to ksettings.

Patch
diff mbox

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 32917bdd1432..bcb4755bcd95 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -958,7 +958,7 @@  int phylink_ethtool_ksettings_set(struct phylink *pl,
 	}
 	mutex_unlock(&pl->state_mutex);
 
-	return ret;
+	return 0;
 }
 EXPORT_SYMBOL_GPL(phylink_ethtool_ksettings_set);