From: Johannes Berg Date: Mon, 21 Nov 2011 09:44:00 +0000 (+0100) Subject: cfg80211: fix regulatory NULL dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de3584bd62d87b4c250129fbc46ca52c80330add;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git cfg80211: fix regulatory NULL dereference By the time userspace returns with a response to the regulatory domain request, the wiphy causing the request might have gone away. If this is so, reject the update but mark the request as having been processed anyway. Cc: Luis R. Rodriguez Signed-off-by: Johannes Berg Cc: stable@vger.kernel.org Signed-off-by: John W. Linville --- diff --git a/net/wireless/reg.c b/net/wireless/reg.c index bc1ec2c26fd0..186b7f2a27b6 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2035,6 +2035,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) } request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); + if (!request_wiphy) { + reg_set_request_processed(); + return -ENODEV; + } if (!last_request->intersect) { int r;