Commit 282e02ab authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Kelsey Skunberg

net: spider_net: Fix the size used in a 'dma_free_coherent()' call

BugLink: https://bugs.launchpad.net/bugs/1892822

[ Upstream commit 36f28f76 ]

Update the size used in 'dma_free_coherent()' in order to match the one
used in the corresponding 'dma_alloc_coherent()', in
'spider_net_init_chain()'.

Fixes: d4ed8f8d ("Spidernet DMA coalescing")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 4d649911
...@@ -297,8 +297,8 @@ spider_net_free_chain(struct spider_net_card *card, ...@@ -297,8 +297,8 @@ spider_net_free_chain(struct spider_net_card *card,
descr = descr->next; descr = descr->next;
} while (descr != chain->ring); } while (descr != chain->ring);
dma_free_coherent(&card->pdev->dev, chain->num_desc, dma_free_coherent(&card->pdev->dev, chain->num_desc * sizeof(struct spider_net_hw_descr),
chain->hwring, chain->dma_addr); chain->hwring, chain->dma_addr);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment