Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d56ab93 authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Jeff Garzik
Browse files

[PATCH] Dereference in tokenring/olympic.c



hi,

coverity found (bug id #225) that we might call free_netdev()
with NULL argument, when alloc_trdev() fails. This patch
changes the goto, so we dont call free_netdev() for
dev == NULL.

Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent a192491a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device
	dev = alloc_trdev(sizeof(struct olympic_private)) ; 
	if (!dev) {
		i = -ENOMEM; 
		goto op_free_dev;
		goto op_release_dev;
	}

	olympic_priv = dev->priv ;
@@ -282,8 +282,8 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device
	if (olympic_priv->olympic_lap)
		iounmap(olympic_priv->olympic_lap);

op_free_dev:
	free_netdev(dev);
op_release_dev:
	pci_release_regions(pdev); 

op_disable_dev: