From 051ac9bc35b1e89aa494dca27de5f31e05474c07 Mon Sep 17 00:00:00 2001 From: Mihir Shete Date: Mon, 16 Dec 2013 09:27:19 +0530 Subject: [PATCH] cfg80211: discard regulatory hints from country IEs with undefined wiphy Regulatory hints are processed in a worker thread and by the time this thread gets a chance to schedule driver can deregister the wiphy on which the country IE was discovered. There is no need to process the hints which are coming from such invalid wiphy devices. Change-Id: I44f6f7b29ed1d0927151a88f3ea9e0c17044bd7e CRs-Fixed: 588103 Signed-off-by: Mihir Shete --- net/wireless/reg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 7107b6e7cb9b..620a2799c06e 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1557,7 +1557,8 @@ static void reg_process_hint(struct regulatory_request *reg_request, if (reg_request->wiphy_idx != WIPHY_IDX_INVALID) wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); - if (reg_initiator == NL80211_REGDOM_SET_BY_DRIVER && !wiphy) { + if ((reg_initiator == NL80211_REGDOM_SET_BY_DRIVER || + reg_initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) && !wiphy) { kfree(reg_request); return; }