Skip to content

Commit

Permalink
[PATCH] Dereference in tokenring/olympic.c
Browse files Browse the repository at this point in the history
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: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Eric Sesterhenn authored and Jeff Garzik committed Jun 23, 2006
1 parent a192491 commit 6d56ab9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/tokenring/olympic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6d56ab9

Please sign in to comment.