diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-04-16 15:20:06 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-04-16 15:20:06 +0200 |
commit | cf0dbba515415bb19b11f9323d5f7bebd7f24fd6 (patch) | |
tree | 375bbc1ade1a92acd6493d224dd701fd7f209014 /drivers/net/wireless/libertas/cfg.c | |
parent | 1cff399ecd9125d8e6a634a1957be1aeb3195a12 (diff) | |
parent | 0340c7dccd80d8706c636e030a6ebbddbddca690 (diff) |
Merge remote branch 'alsa/devel' into topic/misc
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 4396dccd12a..ce7bec402a3 100644 --- a/drivers/net/wireless/libertas/cfg.c +++ b/drivers/net/wireless/libertas/cfg.c @@ -6,6 +6,7 @@ * */ +#include <linux/slab.h> #include <net/cfg80211.h> #include "cfg.h" @@ -172,6 +173,8 @@ int lbs_cfg_register(struct lbs_private *priv) if (ret < 0) lbs_pr_err("cannot register wiphy device\n"); + priv->wiphy_registered = true; + ret = register_netdev(priv->dev); if (ret) lbs_pr_err("cannot register network device\n"); @@ -190,9 +193,11 @@ void lbs_cfg_free(struct lbs_private *priv) if (!wdev) return; - if (wdev->wiphy) { + if (priv->wiphy_registered) wiphy_unregister(wdev->wiphy); + + if (wdev->wiphy) wiphy_free(wdev->wiphy); - } + kfree(wdev); } |