소스 검색

qcacmn: Update wmi ready to false when the legacy cb returns error

Presently even when the ready event legacy callback fails in
creation of the pdev, the error is not propagated correctly. This
can result in accessing the invalid memory.

Check the legacy cb return status and update wmi ready status to
false in case pdev creation fails.

Change-Id: Ia4f94154357debedc94b4b20e789bff80a4047f7
CRs-Fixed: 2426611
Arun Kumar Khandavalli 6 년 전
부모
커밋
65b02b4a8e
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      target_if/init_deinit/src/init_event_handler.c

+ 7 - 2
target_if/init_deinit/src/init_event_handler.c

@@ -441,8 +441,12 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle,
 
 	legacy_callback = target_if_get_psoc_legacy_service_ready_cb();
 	if (legacy_callback)
-		legacy_callback(wmi_ready_event_id,
-				scn_handle, event, data_len);
+		if (legacy_callback(wmi_ready_event_id,
+				    scn_handle, event, data_len)) {
+			target_if_err("Legacy callback returned error!");
+			tgt_hdl->info.wmi_ready = FALSE;
+			goto exit;
+		}
 
 	num_radios = target_psoc_get_num_radios(tgt_hdl);
 	/*
@@ -502,6 +506,7 @@ static int init_deinit_ready_event_handler(ol_scn_t scn_handle,
 out:
 	target_if_btcoex_cfg_enable(psoc, tgt_hdl, event);
 	tgt_hdl->info.wmi_ready = TRUE;
+exit:
 	init_deinit_wakeup_host_wait(psoc, tgt_hdl);
 
 	return 0;