net: ethernet: ave: Fix error returns in ave_init
authorWang Hai <wanghai38@huawei.com>
Fri, 17 Jul 2020 02:50:49 +0000 (10:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 08:18:34 +0000 (10:18 +0200)
[ Upstream commit 1264d7fa3a64d8bea7aebb77253f917947ffda25 ]

When regmap_update_bits failed in ave_init(), calls of the functions
reset_control_assert() and clk_disable_unprepare() were missed.
Add goto out_reset_assert to do this.

Fixes: 57878f2f4697 ("net: ethernet: ave: add support for phy-mode setting of system controller")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/socionext/sni_ave.c

index 38d39c4b5ac83604650bf0ed48a0cdaf041ce97f..603d54f83399ca0c1510237c753c3294483fc09f 100644 (file)
@@ -1191,7 +1191,7 @@ static int ave_init(struct net_device *ndev)
        ret = regmap_update_bits(priv->regmap, SG_ETPINMODE,
                                 priv->pinmode_mask, priv->pinmode_val);
        if (ret)
-               return ret;
+               goto out_reset_assert;
 
        ave_global_reset(ndev);