Skip to content

Commit 01c3521

Browse files
tititiou36davem330
authored andcommitted
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>
1 parent df7c7dd commit 01c3521

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/net/arcnet/com20020-pci.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ static int com20020pci_probe(struct pci_dev *pdev,
225225

226226
card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev),
227227
GFP_KERNEL);
228-
if (!card)
229-
return -ENOMEM;
228+
if (!card) {
229+
ret = -ENOMEM;
230+
goto out_port;
231+
}
230232

231233
card->index = i;
232234
card->pci_priv = priv;

0 commit comments

Comments
 (0)