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>
This commit is contained in:
parent
4228883049
commit
c0a1a0a698
1 changed files with 2 additions and 2 deletions
|
@ -3115,7 +3115,7 @@ static int fec_enet_init(struct net_device *ndev)
|
||||||
fep->bufdesc_size;
|
fep->bufdesc_size;
|
||||||
|
|
||||||
/* Allocate memory for buffer descriptors. */
|
/* Allocate memory for buffer descriptors. */
|
||||||
cbd_base = dma_alloc_coherent(NULL, bd_size, &bd_dma,
|
cbd_base = dmam_alloc_coherent(&fep->pdev->dev, bd_size, &bd_dma,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!cbd_base) {
|
if (!cbd_base) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Add table
Reference in a new issue