diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-06-14 06:03:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-15 23:48:52 -0400 |
commit | a78c16e1b9ea74a64b356d667261a326fdc49513 (patch) | |
tree | f1ed5c55c400b65674e167c1a425449600666722 /drivers/net/phy | |
parent | b06f95272e4d338792414e33a393a436cc3d0905 (diff) |
mdio: mux: avoid 'maybe-uninitialized' warning
The latest changes to the MDIO code introduced a false-positive
warning with gcc-6 (possibly others):
drivers/net/phy/mdio-mux.c: In function 'mdio_mux_init':
drivers/net/phy/mdio-mux.c:188:3: error: 'parent_bus_node' may be used uninitialized in this function [-Werror=maybe-uninitialized]
It's easy to avoid the warning by making sure the parent_bus_node
is initialized in both cases at the start of the function, since
the later 'of_node_put()' call is also valid for a NULL pointer
argument.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: f20e6657a875 ("mdio: mux: Enhanced MDIO mux framework for integrated multiplexers")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/mdio-mux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c index dbd4ecc205dc..963838d4fac1 100644 --- a/drivers/net/phy/mdio-mux.c +++ b/drivers/net/phy/mdio-mux.c | |||
@@ -115,6 +115,7 @@ int mdio_mux_init(struct device *dev, | |||
115 | goto err_parent_bus; | 115 | goto err_parent_bus; |
116 | } | 116 | } |
117 | } else { | 117 | } else { |
118 | parent_bus_node = NULL; | ||
118 | parent_bus = mux_bus; | 119 | parent_bus = mux_bus; |
119 | } | 120 | } |
120 | 121 | ||
@@ -184,8 +185,7 @@ int mdio_mux_init(struct device *dev, | |||
184 | put_device(&pb->mii_bus->dev); | 185 | put_device(&pb->mii_bus->dev); |
185 | 186 | ||
186 | err_parent_bus: | 187 | err_parent_bus: |
187 | if (!mux_bus) | 188 | of_node_put(parent_bus_node); |
188 | of_node_put(parent_bus_node); | ||
189 | return ret_val; | 189 | return ret_val; |
190 | } | 190 | } |
191 | EXPORT_SYMBOL_GPL(mdio_mux_init); | 191 | EXPORT_SYMBOL_GPL(mdio_mux_init); |