qcacmn: sanity checks in hal_attach

In case of memory allocation failures,
return appropriate failure to the caller in hal attach.

Change-Id: Ifc319bbc274d8a13836968d460eb8067857363b8
CRs-Fixed: 3357203
This commit is contained in:
Sai Rupesh Chevuru
2022-12-18 20:46:31 +05:30
committed by Madan Koyyalamudi
부모 70c9b142e8
커밋 166a30648f
4개의 변경된 파일34개의 추가작업 그리고 8개의 파일을 삭제

파일 보기

@@ -1161,13 +1161,22 @@ void *hal_attach(struct hif_opaque_softc *hif_handle, qdf_device_t qdf_dev)
qdf_minidump_log(hal, sizeof(*hal), "hal_soc");
qdf_atomic_init(&hal->active_work_cnt);
hal_delayed_reg_write_init(hal);
if (hal_delayed_reg_write_init(hal) != QDF_STATUS_SUCCESS) {
hal_err("unable to initialize delayed reg write");
goto fail3;
}
hal_reo_shared_qaddr_setup((hal_soc_handle_t)hal);
if (hal_reo_shared_qaddr_setup((hal_soc_handle_t)hal)
!= QDF_STATUS_SUCCESS) {
hal_err("unable to setup reo shared qaddr");
goto fail4;
}
hif_rtpm_register(HIF_RTPM_ID_HAL_REO_CMD, NULL);
return (void *)hal;
fail4:
hal_delayed_reg_write_deinit(hal);
fail3:
qdf_mem_free_consistent(qdf_dev, qdf_dev->dev,
sizeof(*hal->shadow_wrptr_mem_vaddr) *