diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-13 03:28:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-13 03:28:45 -0400 |
commit | 9343af084c7e8911897b0883042ee690cee3aaef (patch) | |
tree | 6211a4bdc84690bec6530d27a3abb19f5e8bb8f3 /drivers/net/wireless/libertas/cfg.c | |
parent | e182c77cc291456eed127b1472952ddb59a81a9d (diff) | |
parent | 0d0fb0f9c5fddef4a10242fe3337f00f528a3099 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
lib/Kconfig.debug
Diffstat (limited to 'drivers/net/wireless/libertas/cfg.c')
-rw-r--r-- | drivers/net/wireless/libertas/cfg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c index 4396dccd12ac..ce7bec402a33 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c | |||
@@ -6,6 +6,7 @@ | |||
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/slab.h> | ||
9 | #include <net/cfg80211.h> | 10 | #include <net/cfg80211.h> |
10 | 11 | ||
11 | #include "cfg.h" | 12 | #include "cfg.h" |
@@ -172,6 +173,8 @@ int lbs_cfg_register(struct lbs_private *priv) | |||
172 | if (ret < 0) | 173 | if (ret < 0) |
173 | lbs_pr_err("cannot register wiphy device\n"); | 174 | lbs_pr_err("cannot register wiphy device\n"); |
174 | 175 | ||
176 | priv->wiphy_registered = true; | ||
177 | |||
175 | ret = register_netdev(priv->dev); | 178 | ret = register_netdev(priv->dev); |
176 | if (ret) | 179 | if (ret) |
177 | lbs_pr_err("cannot register network device\n"); | 180 | lbs_pr_err("cannot register network device\n"); |
@@ -190,9 +193,11 @@ void lbs_cfg_free(struct lbs_private *priv) | |||
190 | if (!wdev) | 193 | if (!wdev) |
191 | return; | 194 | return; |
192 | 195 | ||
193 | if (wdev->wiphy) { | 196 | if (priv->wiphy_registered) |
194 | wiphy_unregister(wdev->wiphy); | 197 | wiphy_unregister(wdev->wiphy); |
198 | |||
199 | if (wdev->wiphy) | ||
195 | wiphy_free(wdev->wiphy); | 200 | wiphy_free(wdev->wiphy); |
196 | } | 201 | |
197 | kfree(wdev); | 202 | kfree(wdev); |
198 | } | 203 | } |