Commit 15e32296 authored by Iyappan Subramanian's avatar Iyappan Subramanian Committed by David S. Miller

drivers: net: xgene: fix: Delete descriptor rings and buffer pools

xgene_enet_init_hw() should delete any descriptor rings and
buffer pools setup should le_ops->cle_init() return an error.
Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e434627
...@@ -1462,10 +1462,8 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata) ...@@ -1462,10 +1462,8 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata)
buf_pool = pdata->rx_ring[i]->buf_pool; buf_pool = pdata->rx_ring[i]->buf_pool;
xgene_enet_init_bufpool(buf_pool); xgene_enet_init_bufpool(buf_pool);
ret = xgene_enet_refill_bufpool(buf_pool, pdata->rx_buff_cnt); ret = xgene_enet_refill_bufpool(buf_pool, pdata->rx_buff_cnt);
if (ret) { if (ret)
xgene_enet_delete_desc_rings(pdata); goto err;
return ret;
}
} }
dst_ring_num = xgene_enet_dst_ring_num(pdata->rx_ring[0]); dst_ring_num = xgene_enet_dst_ring_num(pdata->rx_ring[0]);
...@@ -1482,7 +1480,7 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata) ...@@ -1482,7 +1480,7 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata)
ret = pdata->cle_ops->cle_init(pdata); ret = pdata->cle_ops->cle_init(pdata);
if (ret) { if (ret) {
netdev_err(ndev, "Preclass Tree init error\n"); netdev_err(ndev, "Preclass Tree init error\n");
return ret; goto err;
} }
} else { } else {
pdata->port_ops->cle_bypass(pdata, dst_ring_num, buf_pool->id); pdata->port_ops->cle_bypass(pdata, dst_ring_num, buf_pool->id);
...@@ -1492,6 +1490,10 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata) ...@@ -1492,6 +1490,10 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata)
pdata->mac_ops->init(pdata); pdata->mac_ops->init(pdata);
return ret; return ret;
err:
xgene_enet_delete_desc_rings(pdata);
return ret;
} }
static void xgene_enet_setup_ops(struct xgene_enet_pdata *pdata) static void xgene_enet_setup_ops(struct xgene_enet_pdata *pdata)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment