mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
net: cxgb3_main: Fix a resource leak in a error path in 'init_one()'
[ Upstream commit debea2cd31 ]
A call to 'kfree_skb()' is missing in the error handling path of
'init_one()'.
This is already present in 'remove_one()' but is missing here.
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>
This commit is contained in:
committed by
Chris
parent
9affa110fd
commit
9e085f9d4d
@@ -3263,7 +3263,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
if (!adapter->regs) {
|
||||
dev_err(&pdev->dev, "cannot map device registers\n");
|
||||
err = -ENOMEM;
|
||||
goto out_free_adapter;
|
||||
goto out_free_adapter_nofail;
|
||||
}
|
||||
|
||||
adapter->pdev = pdev;
|
||||
@@ -3381,6 +3381,9 @@ out_free_dev:
|
||||
if (adapter->port[i])
|
||||
free_netdev(adapter->port[i]);
|
||||
|
||||
out_free_adapter_nofail:
|
||||
kfree_skb(adapter->nofail_skb);
|
||||
|
||||
out_free_adapter:
|
||||
kfree(adapter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user