aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti
diff options
context:
space:
mode:
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>2019-05-28 20:45:19 +0300
committerDavid S. Miller <davem@davemloft.net>2019-05-29 21:50:14 -0700
commit02caceded0691a31a21b62011da8dae0d3aec85b (patch)
tree46185d9eeba0a47735b8ae97aef02d9920d61e50 /drivers/net/ethernet/ti
parentMerge branch 'Decoupling-PHYLINK-from-struct-net_device' (diff)
downloadlinux-dev-02caceded0691a31a21b62011da8dae0d3aec85b.tar.xz
linux-dev-02caceded0691a31a21b62011da8dae0d3aec85b.zip
net: ethernet: ti: cpsw: correct .ndo_open error path
It's found while review and probably never happens, but real number of queues is set per device, and error path should be per device. So split error path based on usage_count. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 634fc484a0b3..6d3f1f3f90cb 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1423,8 +1423,11 @@ static int cpsw_ndo_open(struct net_device *ndev)
return 0;
err_cleanup:
- cpdma_ctlr_stop(cpsw->dma);
- for_each_slave(priv, cpsw_slave_stop, cpsw);
+ if (!cpsw->usage_count) {
+ cpdma_ctlr_stop(cpsw->dma);
+ for_each_slave(priv, cpsw_slave_stop, cpsw);
+ }
+
pm_runtime_put_sync(cpsw->dev);
netif_carrier_off(priv->ndev);
return ret;