mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
net: gemini: Fix memory leak in gmac_setup_txqs
[ Upstream commit f37f710353677639bc5d37ee785335994adf2529 ]
In the implementation of gmac_setup_txqs() the allocated desc_ring is
leaked if TX queue base is not aligned. Release it via
dma_free_coherent.
Fixes: 4d5ae32f5e ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f0465803fa
commit
3740ae3cb4
1 changed files with 2 additions and 0 deletions
|
|
@ -576,6 +576,8 @@ static int gmac_setup_txqs(struct net_device *netdev)
|
|||
|
||||
if (port->txq_dma_base & ~DMA_Q_BASE_MASK) {
|
||||
dev_warn(geth->dev, "TX queue base is not aligned\n");
|
||||
dma_free_coherent(geth->dev, len * sizeof(*desc_ring),
|
||||
desc_ring, port->txq_dma_base);
|
||||
kfree(skb_tab);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue