summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2020-08-02 15:53:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-21 10:53:02 +0200
commit80533d2527d42632324e77965cd24d6b3fb8395f (patch)
treee307fe4d0830a554bb95ebca3d16775d97d7e4d7 /drivers
parent8b795d88be68802d9fe84b2e0e9e551ddc09f019 (diff)
downloadlinux-stable-80533d2527d42632324e77965cd24d6b3fb8395f.tar.gz
linux-stable-80533d2527d42632324e77965cd24d6b3fb8395f.tar.bz2
linux-stable-80533d2527d42632324e77965cd24d6b3fb8395f.zip
net: spider_net: Fix the size used in a 'dma_free_coherent()' call
[ Upstream commit 36f28f7687a9ce665479cce5d64ce7afaa9e77ae ] 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: d4ed8f8d1fb7 ("Spidernet DMA coalescing") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/toshiba/spider_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c
index 8e53211aedd8..53600e28d93b 100644
--- a/drivers/net/ethernet/toshiba/spider_net.c
+++ b/drivers/net/ethernet/toshiba/spider_net.c
@@ -297,8 +297,8 @@ spider_net_free_chain(struct spider_net_card *card,
descr = descr->next;
} while (descr != chain->ring);
- dma_free_coherent(&card->pdev->dev, chain->num_desc,
- chain->hwring, chain->dma_addr);
+ dma_free_coherent(&card->pdev->dev, chain->num_desc * sizeof(struct spider_net_hw_descr),
+ chain->hwring, chain->dma_addr);
}
/**