From 2e2aa6962c7f0c7618bb21aa9e59e4e130ccd70b Mon Sep 17 00:00:00 2001 From: Harprit Chhabada Date: Thu, 4 Oct 2018 18:28:28 -0700 Subject: [PATCH] qcacld-3.0: Fix null pointer dereference in wma_pdev_div_info_evt_handler pmac->sme.get_chain_rssi_cb is never checked if WMI_PDEV_DIV_RSSI_ANTID_EVENTID messages is sent anytime by user. pmac->sme.get_chain_rssi_cb can not be appropriately registered and can result in NULL pointer dereference. Change-Id: I64783a0e2d054b45678f126b42de20470d3264d3 CRs-Fixed: 2324128 --- core/wma/src/wma_features.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 3cabd9b26f18..512e54b7ac8e 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -5806,6 +5806,10 @@ int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf, return -EINVAL; } + if (!pmac->sme.get_chain_rssi_cb) { + WMA_LOGE(FL("Invalid get_chain_rssi_cb")); + return -EINVAL; + } param_buf = (WMI_PDEV_DIV_RSSI_ANTID_EVENTID_param_tlvs *) event_buf; if (!param_buf) { WMA_LOGE(FL("Invalid rssi antid event buffer"));