From ec56395f889d5da0f1a68f8e7e8e8d6f4efba282 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 11 Jun 2018 09:57:09 -0700 Subject: [PATCH] qcacld-3.0: Pass correct pointer type to mac_open() In cds_open() the call to mac_open() currently passes a pointer to the gp_cds_context->mac_context field. This is a void * field but mac_open() expects a mac_handle_t * (aka tHalHandle *). This currently compiles because mac_handle_t is itself a void *. But in the future the underlying type of mac_handle_t will change, so pass a pointer to an object of the correct type to mac_open(). Change-Id: Ie3e54c5288bc7d1e9287f30d997b005a5c8dc2ef CRs-Fixed: 2268813 --- core/cds/src/cds_api.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index d7956a8cbbeb..39bb820540ba 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -457,6 +457,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) void *HTCHandle; struct hdd_context *hdd_ctx; struct cds_context *cds_ctx; + mac_handle_t mac_handle; cds_debug("Opening CDS"); @@ -631,7 +632,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) bmi_target_ready(scn, gp_cds_context->cfg_ctx); /* Now proceed to open the MAC */ - status = mac_open(psoc, &(gp_cds_context->mac_context), + status = mac_open(psoc, &mac_handle, gp_cds_context->hdd_context, cds_cfg); if (QDF_STATUS_SUCCESS != status) { @@ -640,9 +641,10 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) QDF_ASSERT(0); goto err_soc_detach; } + gp_cds_context->mac_context = mac_handle; /* Now proceed to open the SME */ - status = sme_open(gp_cds_context->mac_context); + status = sme_open(mac_handle); if (QDF_IS_STATUS_ERROR(status)) { /* Critical Error ... Cannot proceed further */ cds_alert("Failed to open SME"); @@ -655,7 +657,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc) return dispatcher_psoc_open(psoc); err_mac_close: - mac_close(gp_cds_context->mac_context); + mac_close(mac_handle); err_soc_detach: /* todo: add propper error handling */