iwlwifi: fix rfkill memory error
Do not free reference to device twice. After rfkill registration succeeds
we only need to call rfkill_unregister() and not rfkill_free().
Also add some debugging.
Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index f122307..d8a226e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -256,9 +256,13 @@
int iwlcore_low_level_notify(struct iwl_priv *priv,
enum iwlcore_card_notify notify)
{
+ int ret;
switch (notify) {
case IWLCORE_INIT_EVT:
- iwl_rfkill_init(priv);
+ ret = iwl_rfkill_init(priv);
+ if (ret)
+ IWL_ERROR("Unable to initialize RFKILL system. "
+ "Ignoring error: %d\n", ret);
break;
case IWLCORE_START_EVT:
break;
@@ -266,7 +270,6 @@
break;
case IWLCORE_REMOVE_EVT:
iwl_rfkill_unregister(priv);
- iwl_rfkill_free(priv);
break;
}