[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437660380-21164-1-git-send-email-l.stach@pengutronix.de>
Date: Thu, 23 Jul 2015 16:06:19 +0200
From: Lucas Stach <l.stach@...gutronix.de>
To: "David S. Miller" <davem@...emloft.net>
Cc: Duan Andy <fugang.duan@...escale.com>,
Frank Li <Frank.Li@...escale.com>, netdev@...r.kernel.org,
patchwork-lst@...gutronix.de
Subject: [Patch v2 resend 1/2] 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@...gutronix.de>
---
v2: Fix indentation of second line to fix alignment with opening bracket.
---
drivers/net/ethernet/freescale/fec_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 349365d85b92..a7f1bdf718f8 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3142,8 +3142,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;
}
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists