diff options
| author | Balaji Pothunoori <bpothuno@codeaurora.org> | 2019-10-16 19:12:17 +0530 |
|---|---|---|
| committer | nshrivas <nshrivas@codeaurora.org> | 2019-10-23 05:55:24 -0700 |
| commit | c7218e297dbd35f1957e2ea29a53124f85a3c561 (patch) | |
| tree | 9419fcb9413489be5f38e0fb4dffdd9012cb0d01 | |
| parent | a5436dfeac98920c265d6b2862ca3e6d472abd45 (diff) | |
qcacld-3.0: Return failure from hdd_wlan_start_modules
hdd_wlan_start_modules returns success for many error paths. For each
error path in hdd_wlan_start_modules, return an appropriate error code
to the caller to improve error handling.
Change-Id: Id4e6e84a8b833689df1f0a80fba6c25bdc1da857
CRs-Fixed: 2141141
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index f1dc883a15be..f165d57f3d7b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2390,7 +2390,8 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, if (!reinit && !unint) { ret = pld_power_on(qdf_dev->dev); if (ret) { - hdd_err("Failed to Powerup the device: %d", ret); + hdd_err("Failed to Powerup the device; errno: %d", + ret); goto release_lock; } } @@ -2403,7 +2404,7 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, (reinit == true) ? HIF_ENABLE_TYPE_REINIT : HIF_ENABLE_TYPE_PROBE); if (ret) { - hdd_err("Failed to open hif: %d", ret); + hdd_err("Failed to open hif; errno: %d", ret); goto power_down; } @@ -2416,20 +2417,22 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, status = ol_cds_init(qdf_dev, hif_ctx); if (status != QDF_STATUS_SUCCESS) { - hdd_err("No Memory to Create BMI Context :%d", status); + hdd_err("No Memory to Create BMI Context; status: %d", + status); ret = qdf_status_to_os_return(status); goto hif_close; } ret = hdd_update_config(hdd_ctx); if (ret) { - hdd_err("Failed to update configuration :%d", ret); + hdd_err("Failed to update configuration; errno: %d", + ret); goto ol_cds_free; } status = cds_open(); if (!QDF_IS_STATUS_SUCCESS(status)) { - hdd_err("Failed to Open CDS: %d", status); + hdd_err("Failed to Open CDS; status: %d", status); ret = (status == QDF_STATUS_E_NOMEM) ? -ENOMEM : -EINVAL; goto deinit_config; } @@ -2451,8 +2454,8 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, status = cds_pre_enable(hdd_ctx->pcds_context); if (!QDF_IS_STATUS_SUCCESS(status)) { - hdd_err("Failed to pre-enable CDS: %d", status); - ret = (status == QDF_STATUS_E_NOMEM) ? -ENOMEM : -EINVAL; + hdd_err("Failed to pre-enable CDS; status: %d", status); + ret = qdf_status_to_os_return(status); goto deregister_cb; } @@ -2481,9 +2484,10 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, } if (reinit) { - if (hdd_ipa_uc_ssr_reinit(hdd_ctx)) { - hdd_err("HDD IPA UC reinit failed"); - ret = -EINVAL; + ret = hdd_ipa_uc_ssr_reinit(hdd_ctx); + if (ret) { + hdd_err("HDD IPA UC reinit failed; errno: %d", + ret); goto err_ipa_cleanup; } } @@ -2493,16 +2497,19 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, hdd_info("Wlan transition (OPENED -> ENABLED)"); if (!adapter) { hdd_err("adapter is Null"); + ret = -EINVAL; goto err_ipa_cleanup; } if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { hdd_err("in ftm mode, no need to configure cds modules"); + ret = -EINVAL; break; } - if (hdd_configure_cds(hdd_ctx, adapter)) { - hdd_err("Failed to Enable cds modules"); + ret = hdd_configure_cds(hdd_ctx, adapter); + if (ret) { + hdd_err("Failed to Enable cds modules; errno: %d", ret); ret = -EINVAL; goto err_ipa_cleanup; } |
