summaryrefslogtreecommitdiff
path: root/reg.c
diff options
context:
space:
mode:
Diffstat (limited to 'reg.c')
-rw-r--r--reg.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/reg.c b/reg.c
index d62a2014315a..0879a132b67c 100644
--- a/reg.c
+++ b/reg.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/rtnetlink.h>
@@ -146,8 +146,7 @@ int ath11k_reg_update_chan_list(struct ath11k *ar, bool wait)
if (WARN_ON(!num_channels))
return -EINVAL;
- params = kzalloc(struct_size(params, ch_param, num_channels),
- GFP_KERNEL);
+ params = kzalloc_flex(*params, ch_param, num_channels);
if (!params)
return -ENOMEM;
@@ -926,8 +925,11 @@ int ath11k_reg_handle_chan_list(struct ath11k_base *ab,
*/
if (ab->default_regd[pdev_idx] && !ab->new_regd[pdev_idx] &&
!memcmp((char *)ab->default_regd[pdev_idx]->alpha2,
- (char *)reg_info->alpha2, 2))
- goto retfail;
+ (char *)reg_info->alpha2, 2) &&
+ power_type == IEEE80211_REG_UNSET_AP) {
+ ath11k_reg_reset_info(reg_info);
+ return 0;
+ }
/* Intersect new rules with default regd if a new country setting was
* requested, i.e a default regd was already set during initialization