Skip to content

Commit

Permalink
drivers: atm: nicstar: Use the correct function to free some resources
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Christophe Jaillet authored and David S. Miller committed Jul 19, 2016
1 parent 731e6f0 commit eab8146
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/atm/nicstar.c
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit eab8146

Please sign in to comment.