Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ivan Khoronzhuk and committed by
David S. Miller
02cacede 6faaffb3

+5 -2
+5 -2
drivers/net/ethernet/ti/cpsw.c
··· 1423 1423 return 0; 1424 1424 1425 1425 err_cleanup: 1426 - cpdma_ctlr_stop(cpsw->dma); 1427 - for_each_slave(priv, cpsw_slave_stop, cpsw); 1426 + if (!cpsw->usage_count) { 1427 + cpdma_ctlr_stop(cpsw->dma); 1428 + for_each_slave(priv, cpsw_slave_stop, cpsw); 1429 + } 1430 + 1428 1431 pm_runtime_put_sync(cpsw->dev); 1429 1432 netif_carrier_off(priv->ndev); 1430 1433 return ret;