mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
arcnet: com20020-pci: Fix an error handling path in 'com20020pci_probe()'
If this memory allocation fails, we should go through the error handling path as done everywhere else in this function before returning. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
df7c7dd250
commit
01c3521f79
1 changed files with 4 additions and 2 deletions
|
@ -225,8 +225,10 @@ static int com20020pci_probe(struct pci_dev *pdev,
|
|||
|
||||
card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev),
|
||||
GFP_KERNEL);
|
||||
if (!card)
|
||||
return -ENOMEM;
|
||||
if (!card) {
|
||||
ret = -ENOMEM;
|
||||
goto out_port;
|
||||
}
|
||||
|
||||
card->index = i;
|
||||
card->pci_priv = priv;
|
||||
|
|
Loading…
Reference in a new issue