diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index c4857aa1869b..3759edd87440 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -1753,6 +1753,11 @@ static uint16_t reg_compute_chan_to_freq(struct wlan_objmgr_pdev *pdev, return 0; } + if (min_chan_range < MIN_CHANNEL || max_chan_range > MAX_CHANNEL) { + reg_err_rl("Channel range is invalid"); + return 0; + } + chan_list = pdev_priv_obj->mas_chan_list; for (count = min_chan_range; count <= max_chan_range; count++) { diff --git a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h index f5bcf0fc9118..247bb9ea6c77 100644 --- a/umac/regulatory/dispatcher/inc/reg_services_public_struct.h +++ b/umac/regulatory/dispatcher/inc/reg_services_public_struct.h @@ -438,6 +438,9 @@ enum channel_enum { NUM_CHANNELS, + MIN_CHANNEL = CHAN_ENUM_2412, + MAX_CHANNEL = (NUM_CHANNELS - 1), + MIN_24GHZ_CHANNEL = CHAN_ENUM_2412, MAX_24GHZ_CHANNEL = CHAN_ENUM_2484, NUM_24GHZ_CHANNELS = (MAX_24GHZ_CHANNEL - MIN_24GHZ_CHANNEL + 1),