Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1445034 > unrolled thread

[PATCH] drivers: atm: nicstar: Use the correct function to free some resources

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-07-17 09:10 +0200
Last post2016-07-19 20:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drivers: atm: nicstar: Use the correct function to free some resources Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-07-17 09:10 +0200
    Re: [PATCH] drivers: atm: nicstar: Use the correct function to  free some resources David Miller <davem@davemloft.net> - 2016-07-19 20:40 +0200

#1445034 — [PATCH] drivers: atm: nicstar: Use the correct function to free some resources

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-07-17 09:10 +0200
Subject[PATCH] drivers: atm: nicstar: Use the correct function to free some resources
Message-ID<rVOn7-6ad-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1446658 — Re: [PATCH] drivers: atm: nicstar: Use the correct function to free some resources

FromDavid Miller <davem@davemloft.net>
Date2016-07-19 20:40 +0200
SubjectRe: [PATCH] drivers: atm: nicstar: Use the correct function to free some resources
Message-ID<rWI5Y-7uZ-13@gated-at.bofh.it>
In reply to#1445034
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.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web