aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2016-07-17 02:15:50 -0400
committerDavid S. Miller <davem@davemloft.net>2016-07-19 14:30:26 -0400
commit731e6f007aa2d07fc1a420bffeb7c9e8226e89e6 (patch)
treed1a2e997158f55d4b2baf58bf3cdf81614d9c37b /drivers/net/ethernet/ti
parent0d7eacbe637952fc737a968bc16db1f2ccbbe71c (diff)
net: ti: cpmac: Use the correct function to free some resources.
In 'cpmac_open', 'dma_alloc_coherent' has been used to allocate some resources, so we need to free them using 'dma_free_coherent' instead of 'kfree'. Also, we don't need to free these resources if the allocation has failed. So I have slighly modified the goto label in this case. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r--drivers/net/ethernet/ti/cpmac.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index f86497c2888a..29f381b16a44 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1006,8 +1006,10 @@ fail_desc:
1006 kfree_skb(priv->rx_head[i].skb); 1006 kfree_skb(priv->rx_head[i].skb);
1007 } 1007 }
1008 } 1008 }
1009 dma_free_coherent(&dev->dev, sizeof(struct cpmac_desc) * size,
1010 priv->desc_ring, priv->dma_ring);
1011
1009fail_alloc: 1012fail_alloc:
1010 kfree(priv->desc_ring);
1011 iounmap(priv->regs); 1013 iounmap(priv->regs);
1012 1014
1013fail_remap: 1015fail_remap: