Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christophe Jaillet and committed by
David S. Miller
01c3521f df7c7dd2

+4 -2
+4 -2
drivers/net/arcnet/com20020-pci.c
··· 225 225 226 226 card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev), 227 227 GFP_KERNEL); 228 - if (!card) 229 - return -ENOMEM; 228 + if (!card) { 229 + ret = -ENOMEM; 230 + goto out_port; 231 + } 230 232 231 233 card->index = i; 232 234 card->pci_priv = priv;