From bae59f96073b93b959794bbb82c6608683fa2768 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 1 Jun 2018 17:05:43 -0700 Subject: [PATCH] qcacld-3.0: Fix hdd_pre_enable_configure() layering violation Currently hdd_pre_enable_configure() calls cfg_set_str() to update WNI_CFG_STA_ID in the cfg database. Buf cfg_set_str() is an internal MAC API which should not be called by HDD, and this code fails to compile when strict parameter checking is enabled because HDD is passing a tHalHandle to a function which expects a tpAniSirGlobal. Update hdd_pre_enable_configure() to instead call sme_cfg_set_str(). Change-Id: Ic3f249f18319c3e54786938f76fe61b2af37f25f CRs-Fixed: 2254950 --- core/hdd/src/wlan_hdd_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c2279156abfd..6982dbf2b21f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9768,7 +9768,6 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx) { int ret; QDF_STATUS status; - tSirRetStatus hal_status; void *soc = cds_get_context(QDF_MODULE_ID_SOC); cdp_register_pause_cb(soc, wlan_hdd_txrx_pause_cb); @@ -9848,13 +9847,12 @@ static int hdd_pre_enable_configure(struct hdd_context *hdd_ctx) * Set the MAC Address Currently this is used by HAL to add self sta. * Remove this once self sta is added as part of session open. */ - hal_status = cfg_set_str(hdd_ctx->hHal, WNI_CFG_STA_ID, - hdd_ctx->config->intfMacAddr[0].bytes, - sizeof(hdd_ctx->config->intfMacAddr[0])); + status = sme_cfg_set_str(hdd_ctx->hHal, WNI_CFG_STA_ID, + hdd_ctx->config->intfMacAddr[0].bytes, + sizeof(hdd_ctx->config->intfMacAddr[0])); - if (!IS_SIR_STATUS_SUCCESS(hal_status)) { - hdd_err("Failed to set MAC Address. HALStatus is %08d [x%08x]", - hal_status, hal_status); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_err("Failed to set MAC Address, status %d", status); ret = -EINVAL; goto out; }