linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: atm: nicstar: Use the correct function to free some resources
@ 2016-07-17  7:03 Christophe JAILLET
  2016-07-19 18:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2016-07-17  7:03 UTC (permalink / raw)
  To: 3chas3
  Cc: linux-atm-general, netdev, linux-kernel, kernel-janitors,
	Christophe JAILLET

In 'get_scq', 'dma_alloc_coherent' has been used to allocate some
resources, so we need to free them using 'dma_free_coherent' instead
of 'kfree'.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/atm/nicstar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index ddc4ceb..700ed15 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -874,7 +874,8 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd)
 	scq->skb = kmalloc(sizeof(struct sk_buff *) *
 			   (size / NS_SCQE_SIZE), GFP_KERNEL);
 	if (!scq->skb) {
-		kfree(scq->org);
+		dma_free_coherent(&card->pcidev->dev,
+				  2 * size, scq->org, scq->dma);
 		kfree(scq);
 		return NULL;
 	}
-- 
2.7.4


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: atm: nicstar: Use the correct function to free some resources
  2016-07-17  7:03 [PATCH] drivers: atm: nicstar: Use the correct function to free some resources Christophe JAILLET
@ 2016-07-19 18:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-19 18:31 UTC (permalink / raw)
  To: christophe.jaillet
  Cc: 3chas3, linux-atm-general, netdev, linux-kernel, kernel-janitors

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Sun, 17 Jul 2016 09:03:24 +0200

> In 'get_scq', 'dma_alloc_coherent' has been used to allocate some
> resources, so we need to free them using 'dma_free_coherent' instead
> of 'kfree'.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-19 18:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-17  7:03 [PATCH] drivers: atm: nicstar: Use the correct function to free some resources Christophe JAILLET
2016-07-19 18:31 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).