OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4228883
)
net: fec: use managed DMA API functions to allocate BD ring
author
Lucas Stach
<l.stach@pengutronix.de>
Thu, 23 Jul 2015 14:06:19 +0000
(16:06 +0200)
committer
David S. Miller
<davem@davemloft.net>
Mon, 27 Jul 2015 04:51:53 +0000
(21:51 -0700)
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>
drivers/net/ethernet/freescale/fec_main.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/freescale/fec_main.c
b/drivers/net/ethernet/freescale/fec_main.c
index
1f89c59
..
2945b62
100644
(file)
--- 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 = dma
m_alloc_coherent(&fep->pdev->dev
, bd_size, &bd_dma,
+
GFP_KERNEL);
if (!cbd_base) {
return -ENOMEM;
}