Skip to content

Commit

Permalink
ethernet: tundra: free irq when alloc ring failed in tsi108_open()
Browse files Browse the repository at this point in the history
[ Upstream commit acce400 ]

When alloc tx/rx ring failed in tsi108_open(), it doesn't free irq. Fix
it.

Fixes: 5e123b8 ("[PATCH] Add tsi108/9 On Chip Ethernet device driver support")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Link: https://lore.kernel.org/r/20221109044016.126866-1-shaozhengchao@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
zhengchaoshao authored and gregkh committed Nov 16, 2022
1 parent 1aaabd2 commit 2a2a0f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/tundra/tsi108_eth.c
Expand Up @@ -1303,12 +1303,15 @@ static int tsi108_open(struct net_device *dev)

data->rxring = dma_alloc_coherent(&data->pdev->dev, rxring_size,
&data->rxdma, GFP_KERNEL);
if (!data->rxring)
if (!data->rxring) {
free_irq(data->irq_num, dev);
return -ENOMEM;
}

data->txring = dma_alloc_coherent(&data->pdev->dev, txring_size,
&data->txdma, GFP_KERNEL);
if (!data->txring) {
free_irq(data->irq_num, dev);
dma_free_coherent(&data->pdev->dev, rxring_size, data->rxring,
data->rxdma);
return -ENOMEM;
Expand Down

0 comments on commit 2a2a0f2

Please sign in to comment.