From 692eed125de3fbe9f19be63a178358393a7bec5b Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Mon, 20 Aug 2018 18:40:11 -0700 Subject: [PATCH] qcacld-3.0: Check for WMA context before sending TWT command Check for WMA context before sending the TWT enable command to the firmware. Change-Id: I27c131773506c89fc7ba3e95fa58daa1258733fc CRs-Fixed: 2299786 --- core/wma/src/wma_twt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/wma/src/wma_twt.c b/core/wma/src/wma_twt.c index 90b4b37df929..a4d7e007e7b8 100644 --- a/core/wma/src/wma_twt.c +++ b/core/wma/src/wma_twt.c @@ -33,6 +33,10 @@ void wma_send_twt_enable_cmd(uint32_t pdev_id, uint32_t congestion_timeout) struct wmi_twt_enable_param twt_enable_params = {0}; int32_t ret; + if (!wma) { + WMA_LOGE("Invalid WMA context, enable TWT failed"); + return; + } twt_enable_params.pdev_id = pdev_id; twt_enable_params.sta_cong_timer_ms = congestion_timeout; ret = wmi_unified_twt_enable_cmd(wma->wmi_handle, &twt_enable_params);