diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-06-21 10:17:17 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-06-22 23:24:18 -0400 |
commit | 6d56ab936237b429366ade0d2a1540c7e41beb87 (patch) | |
tree | 6e767fd02c7c43aa72d600bdb5057c14dd05d56f /drivers/net/tokenring | |
parent | a192491ad58098f2c57d2d1efe721ea0634dc0aa (diff) |
[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: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/tokenring')
-rw-r--r-- | drivers/net/tokenring/olympic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c index 23032a7bc0a9..c3cb8d26cfe3 100644 --- a/drivers/net/tokenring/olympic.c +++ b/drivers/net/tokenring/olympic.c | |||
@@ -217,7 +217,7 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device | |||
217 | dev = alloc_trdev(sizeof(struct olympic_private)) ; | 217 | dev = alloc_trdev(sizeof(struct olympic_private)) ; |
218 | if (!dev) { | 218 | if (!dev) { |
219 | i = -ENOMEM; | 219 | i = -ENOMEM; |
220 | goto op_free_dev; | 220 | goto op_release_dev; |
221 | } | 221 | } |
222 | 222 | ||
223 | olympic_priv = dev->priv ; | 223 | olympic_priv = dev->priv ; |
@@ -282,8 +282,8 @@ op_free_iomap: | |||
282 | if (olympic_priv->olympic_lap) | 282 | if (olympic_priv->olympic_lap) |
283 | iounmap(olympic_priv->olympic_lap); | 283 | iounmap(olympic_priv->olympic_lap); |
284 | 284 | ||
285 | op_free_dev: | ||
286 | free_netdev(dev); | 285 | free_netdev(dev); |
286 | op_release_dev: | ||
287 | pci_release_regions(pdev); | 287 | pci_release_regions(pdev); |
288 | 288 | ||
289 | op_disable_dev: | 289 | op_disable_dev: |