Skip to content

Commit c0d470e

Browse files
jmberg-intelgregkh
authored andcommitted
cfg80211: check reg_rule for NULL in handle_channel_custom()
[ Upstream commit a7ee7d4 ] 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 <[email protected]> Link: https://lore.kernel.org/r/20200221104449.3b558a50201c.I4ad3725c4dacaefd2d18d3cc65ba6d18acd5dbfe@changeid Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5e95329 commit c0d470e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/wireless/reg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ static void handle_channel_custom(struct wiphy *wiphy,
17301730
break;
17311731
}
17321732

1733-
if (IS_ERR(reg_rule)) {
1733+
if (IS_ERR_OR_NULL(reg_rule)) {
17341734
pr_debug("Disabling freq %d MHz as custom regd has no rule that fits it\n",
17351735
chan->center_freq);
17361736
if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) {

0 commit comments

Comments
 (0)