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
This commit is contained in:
Arun Kumar Khandavalli 2019-03-20 15:54:43 +05:30 • committed by nshrivas
commit 65b02b4a8e

View file

@ -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;