lkml.org 
[lkml]   [2018]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 123/159] net: ethernet: arc: fix error handling in emac_rockchip_probe
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Branislav Radocaj <branislav@radocaj.org>


    [ Upstream commit e46772a6946a7d1f3fbbc1415871851d6651f1d4 ]

    If clk_set_rate() fails, we should disable clk before return.
    Found by Linux Driver Verification project (linuxtesting.org).

    Signed-off-by: Branislav Radocaj <branislav@radocaj.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/arc/emac_rockchip.c | 7 +++++--
    1 file changed, 5 insertions(+), 2 deletions(-)

    --- a/drivers/net/ethernet/arc/emac_rockchip.c
    +++ b/drivers/net/ethernet/arc/emac_rockchip.c
    @@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct pl

    /* RMII TX/RX needs always a rate of 25MHz */
    err = clk_set_rate(priv->macclk, 25000000);
    - if (err)
    + if (err) {
    dev_err(dev,
    "failed to change mac clock rate (%d)\n", err);
    + goto out_clk_disable_macclk;
    + }
    }

    err = arc_emac_probe(ndev, interface);
    @@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct pl
    }

    return 0;
    -
    +out_clk_disable_macclk:
    + clk_disable_unprepare(priv->macclk);
    out_regulator_disable:
    if (priv->regulator)
    regulator_disable(priv->regulator);

    \
     
     \ /
      Last update: 2018-02-23 20:18    [W:4.098 / U:23.892 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site