Skip to content

Commit

Permalink
cfg80211: fix regulatory NULL dereference
Browse files Browse the repository at this point in the history
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 <lrodriguez@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Nov 21, 2011
1 parent 9c8f2c4 commit de3584b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit de3584b

Please sign in to comment.