From: Christophe Jaillet Date: Sun, 17 Jul 2016 07:03:24 +0000 (+0200) Subject: drivers: atm: nicstar: Use the correct function to free some resources X-Git-Tag: v4.8-rc1~140^2~74 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=eab814661945656d35d4a0e5870e932cd7139977;p=linux.git drivers: atm: nicstar: Use the correct function to free some resources 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 Signed-off-by: David S. Miller --- diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index ddc4ceb85fc5..700ed15c2362 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; }