Преглед на файлове

qcacld-3.0: Avoid possible NULL pointer dereference

In target_if_get_roam_vendor_control_param_event_handler,
there are 2 possible NULL pointer dereference issues:

1. Host calls target_if_get_psoc_from_scn_hdl API to get
   psoc object. But as per current logic even if psoc is
   NULL, psoc is dereferenced by passing it as an argument
   to get_wmi_unified_hdl_from_psoc.

2. Host calls get_wmi_unified_hdl_from_psoc API to get
   wmi_handle pointer. But as per current logic even if
   wmi_handle is NULL, wmi_handle is dereferenced by
   passing is as an argument 1 to function
   wmi_extract_roam_vendor_control_param_event.

Fix is to update the sanity check logic for psoc and
wmi_handle pointers to avoid possible NULL pointer
dereference.

Change-Id: I3c3df062b538b05218e729d7bf6806e221073269
CRs-Fixed: 3242435
abhinav kumar преди 2 години
родител
ревизия
f66512e051
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      components/target_if/connection_mgr/src/target_if_cm_roam_event.c

+ 2 - 2
components/target_if/connection_mgr/src/target_if_cm_roam_event.c

@@ -662,13 +662,13 @@ int target_if_get_roam_vendor_control_param_event_handler(ol_scn_t scn,
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
 	if (!psoc) {
 		target_if_err("psoc is null");
-		ret = -EINVAL;
+		return -EINVAL;
 	}
 
 	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
 	if (!wmi_handle) {
 		target_if_err("wmi_handle is null");
-		ret = -EINVAL;
+		return -EINVAL;
 	}
 
 	qdf_status = wmi_extract_roam_vendor_control_param_event(wmi_handle,