Commit d92a8e81 authored by Julia Lawall's avatar Julia Lawall Committed by John W. Linville

net/ieee80211: adjust error handling

Converts a test in error handling code to a sequence of labels.

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1ff41eb0
...@@ -157,7 +157,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ...@@ -157,7 +157,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
err = ieee80211_networks_allocate(ieee); err = ieee80211_networks_allocate(ieee);
if (err) { if (err) {
IEEE80211_ERROR("Unable to allocate beacon storage: %d\n", err); IEEE80211_ERROR("Unable to allocate beacon storage: %d\n", err);
goto failed; goto failed_free_netdev;
} }
ieee80211_networks_initialize(ieee); ieee80211_networks_initialize(ieee);
...@@ -193,9 +193,9 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ...@@ -193,9 +193,9 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
return dev; return dev;
failed: failed_free_netdev:
if (dev) free_netdev(dev);
free_netdev(dev); failed:
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment