Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0a1a0a6 authored by Lucas Stach's avatar Lucas Stach Committed by David S. Miller
Browse files

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: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 42288830
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3115,7 +3115,7 @@ 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,
	cbd_base = dmam_alloc_coherent(&fep->pdev->dev, bd_size, &bd_dma,
				       GFP_KERNEL);
	if (!cbd_base) {
		return -ENOMEM;