Jelajahi Sumber

qcacmn: Check ce_state for null before dereference in ce_mark_datapath

Dereference was happening before the null check. Also simplified the
data structure traversal since we are inside hif.

Change-Id: I2370402f3d080bd413ab949a40dc5d97fba6be27
CRs-Fixed: 1072077
Houston Hoffman 8 tahun lalu
induk
melakukan
55fcf5a1c8
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      hif/src/ce/ce_main.c

+ 3 - 2
hif/src/ce/ce_main.c

@@ -521,10 +521,11 @@ bool ce_mark_datapath(struct CE_state *ce_state)
 	size_t map_sz;
 	int    i;
 	bool   rc = false;
-	struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(ce_state->scn);
-	struct hif_target_info *tgt_info = hif_get_target_info_handle(hif_hdl);
+	struct hif_target_info *tgt_info;
 
 	if (ce_state != NULL) {
+		tgt_info = &ce_state->scn->target_info;
+
 		if (QDF_IS_EPPING_ENABLED(hif_get_conparam(ce_state->scn))) {
 			svc_map = target_service_to_ce_map_wlan_epping;
 			map_sz = sizeof(target_service_to_ce_map_wlan_epping) /