Merge remote-tracking branch 'stable/linux-3.0.y' into develop-3.0-jb
[firefly-linux-kernel-4.4.55.git] / net / wireless / reg.c
index 90b73d1f902acc53afc88747ef2bb1f9ddcbd7d9..092775af035c8856ed256d4419a9a726345e20ee 100644 (file)
@@ -1781,6 +1781,7 @@ static void restore_alpha2(char *alpha2, bool reset_user)
 static void restore_regulatory_settings(bool reset_user)
 {
        char alpha2[2];
+       char world_alpha2[2];
        struct reg_beacon *reg_beacon, *btmp;
        struct regulatory_request *reg_request, *tmp;
        LIST_HEAD(tmp_reg_req_list);
@@ -1831,11 +1832,13 @@ static void restore_regulatory_settings(bool reset_user)
 
        /* First restore to the basic regulatory settings */
        cfg80211_regdomain = cfg80211_world_regdom;
+       world_alpha2[0] = cfg80211_regdomain->alpha2[0];
+       world_alpha2[1] = cfg80211_regdomain->alpha2[1];
 
        mutex_unlock(&reg_mutex);
        mutex_unlock(&cfg80211_mutex);
 
-       regulatory_hint_core(cfg80211_regdomain->alpha2);
+       regulatory_hint_core(world_alpha2);
 
        /*
         * This restores the ieee80211_regdom module parameter