Patch "net: ravb: Check return value of reset_control_deassert()" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: ravb: Check return value of reset_control_deassert()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-ravb-check-return-value-of-reset_control_deasser.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4d9cbf201fda0f1d363d63144ddcefe72663ca4f
Author: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
Date:   Tue Nov 28 10:04:34 2023 +0200

    net: ravb: Check return value of reset_control_deassert()
    
    [ Upstream commit d8eb6ea4b302e7ff78535c205510e359ac10a0bd ]
    
    reset_control_deassert() could return an error. Some devices cannot work
    if reset signal de-assert operation fails. To avoid this check the return
    code of reset_control_deassert() in ravb_probe() and take proper action.
    
    Along with it, the free_netdev() call from the error path was moved after
    reset_control_assert() on its own label (out_free_netdev) to free
    netdev in case reset_control_deassert() fails.
    
    Fixes: 0d13a1a464a0 ("ravb: Add reset support")
    Reviewed-by: Sergey Shtylyov <s.shtylyov@xxxxxx>
    Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
    Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 020edbd0a44a6..2bcea9fdd2653 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2670,7 +2670,10 @@ static int ravb_probe(struct platform_device *pdev)
 	ndev->features = info->net_features;
 	ndev->hw_features = info->net_hw_features;
 
-	reset_control_deassert(rstc);
+	error = reset_control_deassert(rstc);
+	if (error)
+		goto out_free_netdev;
+
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_get_sync(&pdev->dev);
 
@@ -2897,11 +2900,11 @@ static int ravb_probe(struct platform_device *pdev)
 out_disable_refclk:
 	clk_disable_unprepare(priv->refclk);
 out_release:
-	free_netdev(ndev);
-
 	pm_runtime_put(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 	reset_control_assert(rstc);
+out_free_netdev:
+	free_netdev(ndev);
 	return error;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux