summaryrefslogtreecommitdiffstats
path: root/drivers/net/arcnet
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-07-07 06:56:16 +0200
committerDavid S. Miller <davem@davemloft.net>2017-07-07 10:29:10 +0200
commit01c3521f794ce945c586f99e93058df97358a8b6 (patch)
tree18ff9f2766b5e23ffce18dc2f914f486c27b2fb4 /drivers/net/arcnet
parentnfp: flower: add missing clean up call to avoid memory leaks (diff)
downloadlinux-01c3521f794ce945c586f99e93058df97358a8b6.tar.xz
linux-01c3521f794ce945c586f99e93058df97358a8b6.zip
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>
Diffstat (limited to 'drivers/net/arcnet')
-rw-r--r--drivers/net/arcnet/com20020-pci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
index 2d956cb59d06..01cab9548785 100644
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -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;