[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20150721.003251.609707799765780058.davem@davemloft.net>
Date: Tue, 21 Jul 2015 00:32:51 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: l.stach@...gutronix.de
Cc: fugang.duan@...escale.com, Frank.Li@...escale.com,
netdev@...r.kernel.org, kernel@...gutronix.de,
patchwork-lst@...gutronix.de
Subject: Re: [PATCH 1/2] net: fec: use managed DMA API functions to
allocate BD ring
From: Lucas Stach <l.stach@...gutronix.de>
Date: Mon, 20 Jul 2015 15:51:37 +0200
> 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>
> ---
> drivers/net/ethernet/freescale/fec_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index 349365d85b92..b3287c6b069b 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -3142,7 +3142,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);
When you change the column of the openning parenthesis of a function call, you
must fix up the indentation of the second and subsequent lines so that they all
properly start at the first column after that openning parenthesis.
--
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