[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <403e8b6d-57df-e8d1-316c-150f833de842@web.de>
Date: Sun, 15 Dec 2019 15:27:31 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Navid Emamdoost <navid.emamdoost@...il.com>,
linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Linus Walleij <linus.walleij@...aro.org>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Navid Emamdoost <emamd001@....edu>,
Hans Ulli Kroll <ulli.kroll@...glemail.com>
Subject: Re: [PATCH] net: gemini: Fix memory leak in gmac_setup_txqs
> +++ b/drivers/net/ethernet/cortina/gemini.c
> @@ -576,6 +576,8 @@ static int gmac_setup_txqs(struct net_device *netdev)
>
> if (port->txq_dma_base & ~DMA_Q_BASE_MASK) {
> dev_warn(geth->dev, "TX queue base is not aligned\n");
> + dma_free_coherent(geth->dev, len * sizeof(*desc_ring),
> + desc_ring, port->txq_dma_base);
> kfree(skb_tab);
> return -ENOMEM;
> }
The added function call seems to be fine.
Would you like to avoid a bit of duplicate code for the exception handling?
Regards,
Markus
Powered by blists - more mailing lists