diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index 956d5f835332..84fdfc31454c 100644 --- a/target_if/core/inc/target_if.h +++ b/target_if/core/inc/target_if.h @@ -51,6 +51,8 @@ QDF_TRACE_EXIT(QDF_MODULE_ID_TARGET_IF, "exit") #define target_if_err_rl(params...) \ QDF_TRACE_ERROR_RL(QDF_MODULE_ID_TARGET_IF, params) +#define target_if_debug_rl(params...) \ + QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_TARGET_IF, params) #define targetif_nofl_fatal(params...) \ diff --git a/target_if/regulatory/src/target_if_reg_lte.c b/target_if/regulatory/src/target_if_reg_lte.c index 762240a62eee..e0b25c2c2965 100644 --- a/target_if/regulatory/src/target_if_reg_lte.c +++ b/target_if/regulatory/src/target_if_reg_lte.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -75,6 +75,11 @@ static int tgt_reg_ch_avoid_event_handler(ol_scn_t handle, uint8_t *event_buf, return -EFAULT; } + if (!ch_avoid_event.ch_avoid_range_cnt) { + target_if_debug_rl("ch avoid range count is 0, dropping the event"); + return 0; + } + status = reg_rx_ops->reg_ch_avoid_event_handler(psoc, &ch_avoid_event); if (status != QDF_STATUS_SUCCESS) { target_if_err("Failed to process CH avoid event");