forked from Minki/linux
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
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user