Jelajahi Sumber

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
Varun Reddy Yeturu 6 tahun lalu
induk
melakukan
692eed125d
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      core/wma/src/wma_twt.c

+ 4 - 0
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);