Skip to content

Commit eab8146

Browse files
tititiou36davem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 731e6f0 commit eab8146

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/atm/nicstar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,8 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd)
874874
scq->skb = kmalloc(sizeof(struct sk_buff *) *
875875
(size / NS_SCQE_SIZE), GFP_KERNEL);
876876
if (!scq->skb) {
877-
kfree(scq->org);
877+
dma_free_coherent(&card->pcidev->dev,
878+
2 * size, scq->org, scq->dma);
878879
kfree(scq);
879880
return NULL;
880881
}

0 commit comments

Comments
 (0)