From 8365076f1e6bf6d32f1574f493e70db860a5d372 Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Wed, 29 May 2013 18:24:30 -0700 Subject: [PATCH] prima: prevent crash on selecting only 2.4GHz bands Signed-off-by: Iliyan Malchev --- drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c index b6bbb02a07bf..ccc3fa678dd5 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c @@ -2395,6 +2395,10 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, } /* Haven't seen any condition that will set by driver after init. If we do, then we should also call sme_ChangeCountryCode */ + + if (!wiphy->bands[IEEE80211_BAND_5GHZ]) + goto check_initiator; + for (j=0; jbands[IEEE80211_BAND_5GHZ ]->n_channels; j++) { // p2p UNII-1 band channels are passive when domain is FCC. @@ -2415,6 +2419,9 @@ int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, wiphy->bands[IEEE80211_BAND_5GHZ ]->channels[j].flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; } } + +check_initiator: + if (request->initiator == NL80211_REGDOM_SET_BY_CORE) { request->processed = 1;