summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav Kumar <abhikuma@codeaurora.org>2018-05-10 12:01:23 +0530
committernshrivas <nshrivas@codeaurora.org>2018-05-16 07:17:02 -0700
commit563e2684bcfd9c4bddd5dfa6f77d8f2eed246d76 (patch)
treee156e0c77a34f184365fa62fe733dc78efab0448
parent23d75c1c71ec61bac4b8d3ea6fc8cc938fcb8382 (diff)
qcacld-3.0: Avoid possible NULL pointer dereference
Possible NULL pointer dereference can happen in spectral_process_phyerr, when dereferencing the pointer "wma->dfs_ic->ic_curchan". Validate the pointer "wma->dfs_ic->ic_curchan" before using it. Change-Id: Icf97c397b97b1a6ac19509364e619bbe06beb4c9 CRs-Fixed: 2236505
-rw-r--r--core/wma/src/wma_features.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c
index 68da6d660be8..eeb1c085c7b3 100644
--- a/core/wma/src/wma_features.c
+++ b/core/wma/src/wma_features.c
@@ -2944,6 +2944,11 @@ static QDF_STATUS spectral_process_phyerr(tp_wma_handle wma, uint8_t *data,
get_spectral_control_info(wma, &upper_is_control, &lower_is_control);
+ if (!wma->dfs_ic || !wma->dfs_ic->ic_curchan) {
+ WMA_LOGE("%s: channel information is not available", __func__);
+ return QDF_STATUS_E_FAILURE;
+ }
+
if (upper_is_control)
rssi_up = control_rssi;
else