diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2015-07-23 16:06:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-26 21:51:53 -0700 |
commit | c0a1a0a698bb0f90ec4719de34f37715abfad8a5 (patch) | |
tree | ba5bdb87fb73417b41e54df0523237b3c247d489 /drivers/net/ethernet | |
parent | 42288830494cd51873ca745a7a229023df061226 (diff) | |
download | blackbird-op-linux-c0a1a0a698bb0f90ec4719de34f37715abfad8a5.tar.gz blackbird-op-linux-c0a1a0a698bb0f90ec4719de34f37715abfad8a5.zip |
net: fec: use managed DMA API functions to allocate BD ring
So it gets freed when the device is going away.
This fixes a DMA memory leak on driver probe() fail and driver
remove().
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 1f89c59b4353..2945b62b6dc5 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3115,8 +3115,8 @@ static int fec_enet_init(struct net_device *ndev) fep->bufdesc_size; /* Allocate memory for buffer descriptors. */ - cbd_base = dma_alloc_coherent(NULL, bd_size, &bd_dma, - GFP_KERNEL); + cbd_base = dmam_alloc_coherent(&fep->pdev->dev, bd_size, &bd_dma, + GFP_KERNEL); if (!cbd_base) { return -ENOMEM; } |