mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] drivers/net/r6040.c: adjust error handling
@ 2008-07-16 14:34 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2008-07-16 14:34 UTC (permalink / raw)
  To: davem, netdev, jeff, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

The just preceding error case does a lot of error handling, so it seems
like this one should as well.

The semantic match that found the problem is:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression E,E1,E2;
@@

E = alloc_etherdev(...)
... when != E = E1
if (...) { ... free_netdev(E); ... return ...; }
... when != E = E2
(
  if (...)
   {
   ... when != free_netdev(E);
   return dev; }
|
* if (...)
   {
   ... when != free_netdev(E);
   return ...; }
|
register_netdev(E)
)

// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
diff -u -p a/drivers/net/r6040.c b/drivers/net/r6040.c
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -1029,7 +1029,8 @@ static int __devinit r6040_init_one(stru
 	if (!ioaddr) {
 		printk(KERN_ERR "ioremap failed for device %s\n",
 			pci_name(pdev));
-		return -EIO;
+		err = -EIO;
+		goto err_out_res;
 	}
 
 	/* Init system & device */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-16 14:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-16 14:34 [PATCH 1/2] drivers/net/r6040.c: adjust error handling Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®