Skip to content

Commit d8eb6ea

Browse files
claudiubezneaPaolo Abeni
authored andcommitted
net: ravb: Check return value of reset_control_deassert()
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: 0d13a1a ("ravb: Add reset support") Reviewed-by: Sergey Shtylyov <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 91fdb30 commit d8eb6ea

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,7 +2654,10 @@ static int ravb_probe(struct platform_device *pdev)
26542654
ndev->features = info->net_features;
26552655
ndev->hw_features = info->net_hw_features;
26562656

2657-
reset_control_deassert(rstc);
2657+
error = reset_control_deassert(rstc);
2658+
if (error)
2659+
goto out_free_netdev;
2660+
26582661
pm_runtime_enable(&pdev->dev);
26592662
pm_runtime_get_sync(&pdev->dev);
26602663

@@ -2881,11 +2884,11 @@ static int ravb_probe(struct platform_device *pdev)
28812884
out_disable_refclk:
28822885
clk_disable_unprepare(priv->refclk);
28832886
out_release:
2884-
free_netdev(ndev);
2885-
28862887
pm_runtime_put(&pdev->dev);
28872888
pm_runtime_disable(&pdev->dev);
28882889
reset_control_assert(rstc);
2890+
out_free_netdev:
2891+
free_netdev(ndev);
28892892
return error;
28902893
}
28912894

0 commit comments

Comments
 (0)