diff options
author | Johannes Berg <johannes.berg@intel.com> | 2020-02-21 12:44:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-20 12:54:24 +0300 |
commit | 8da8673cbe9525fd4439dbbd189766ba993e554d (patch) | |
tree | c6eb8b31690e7cae48c4e4b7d5f8f3a257b6aacd | |
parent | 1d3e7e1be06f08c380a28cf1ed8578b7b87cbfea (diff) | |
download | linux-8da8673cbe9525fd4439dbbd189766ba993e554d.tar.xz |
cfg80211: check reg_rule for NULL in handle_channel_custom()
[ Upstream commit a7ee7d44b57c9ae174088e53a668852b7f4f452d ]
We may end up with a NULL reg_rule after the loop in
handle_channel_custom() if the bandwidth didn't fit,
check if this is the case and bail out if so.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20200221104449.3b558a50201c.I4ad3725c4dacaefd2d18d3cc65ba6d18acd5dbfe@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/wireless/reg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index a520f433d476..b95d1c2bdef7 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1733,7 +1733,7 @@ static void handle_channel_custom(struct wiphy *wiphy, break; } - if (IS_ERR(reg_rule)) { + if (IS_ERR_OR_NULL(reg_rule)) { pr_debug("Disabling freq %d MHz as custom regd has no rule that fits it\n", chan->center_freq); if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) { |