Explorar o código

qcacld-3.0: Add null vdev check in logging config

Currently, host driver takes vdev reference while sending coex
logging config to the target. If user issues logging config
command before creating vdev, then vdev will be null and
dereferencing it causes crash in driver.

To fix this, add null check for vdev just after taking reference.

Change-Id: I91d7834ecdc506a7b7a20b38a7c8150bd22adb72
CRs-Fixed: 3637112
Rahul Gusain hai 1 ano
pai
achega
581c1128bd
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      components/coex/dispatcher/src/wlan_coex_ucfg_api.c

+ 6 - 1
components/coex/dispatcher/src/wlan_coex_ucfg_api.c

@@ -128,13 +128,18 @@ ucfg_coex_send_logging_config(struct wlan_objmgr_psoc *psoc,
 	QDF_STATUS status;
 	QDF_STATUS status;
 
 
 	if (apps_args[0] != COEX_CONFIG_ENABLE_CONT_INFO) {
 	if (apps_args[0] != COEX_CONFIG_ENABLE_CONT_INFO) {
-		coex_err("invalid cmd %d", apps_args);
+		coex_err("invalid cmd %d", apps_args[0]);
 		return QDF_STATUS_E_FAILURE;
 		return QDF_STATUS_E_FAILURE;
 	}
 	}
 
 
 	vdev = wlan_objmgr_get_vdev_by_opmode_from_psoc(psoc, QDF_STA_MODE,
 	vdev = wlan_objmgr_get_vdev_by_opmode_from_psoc(psoc, QDF_STA_MODE,
 							WLAN_COEX_ID);
 							WLAN_COEX_ID);
 
 
+	if (!vdev) {
+		coex_err("vdev is null");
+		return QDF_STATUS_E_INVAL;
+	}
+
 	param.vdev_id = wlan_vdev_get_id(vdev);
 	param.vdev_id = wlan_vdev_get_id(vdev);
 	param.config_type = WMI_COEX_CONFIG_ENABLE_CONT_INFO;
 	param.config_type = WMI_COEX_CONFIG_ENABLE_CONT_INFO;
 	param.config_arg1 = apps_args[1];
 	param.config_arg1 = apps_args[1];