]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: renesas: ravb: unintialized return value
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 1 Dec 2016 20:57:44 +0000 (23:57 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Dec 2016 18:59:47 +0000 (13:59 -0500)
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>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/ravb_main.c

index f1f3be2cfe215b87f5c39a9d5c8153c8489d853c..d6a217874a8bc2f79fe4c255bc43feea611870a5 100644 (file)
@@ -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");