diff options
| author | Houston Hoffman <hhoffman@codeaurora.org> | 2016-06-15 12:38:47 -0700 |
|---|---|---|
| committer | Vishwajith Upendra <vishwaji@codeaurora.org> | 2016-06-23 12:28:26 -0700 |
| commit | e248264ce4b7243ba7d25b5eb7aa199bd8ffb121 (patch) | |
| tree | 2950a41e8629cd29bdb38b5539352842e2a5d347 | |
| parent | 769d982071fb01c0aaf0ff6e82d4ab7c7b63cae5 (diff) | |
qcacld-3.0: Add context checking in epping_disable
epping_disable needed to check that contexts were
not null before trying to perform the disable opperations.
Change-Id: Ia8182b1deed1a6a1d2643f91660880fb52450e3d
CRs-Fixed: 1027691
| -rw-r--r-- | core/utils/epping/src/epping_main.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/core/utils/epping/src/epping_main.c b/core/utils/epping/src/epping_main.c index 44ddc824b9ca..e7b6c6771492 100644 --- a/core/utils/epping/src/epping_main.c +++ b/core/utils/epping/src/epping_main.c @@ -110,6 +110,8 @@ int epping_open(void) void epping_disable(void) { epping_context_t *pEpping_ctx; + struct hif_opaque_softc *hif_ctx; + HTC_HANDLE htc_handle; pEpping_ctx = g_epping_ctx; if (pEpping_ctx == NULL) { @@ -117,15 +119,30 @@ void epping_disable(void) "%s: error: pEpping_ctx = NULL", __func__); return; } + if (pEpping_ctx->epping_adapter) { epping_destroy_adapter(pEpping_ctx->epping_adapter); pEpping_ctx->epping_adapter = NULL; } - hif_disable_isr(cds_get_context(QDF_MODULE_ID_HIF)); - hif_reset_soc(cds_get_context(QDF_MODULE_ID_HIF)); - htc_stop(cds_get_context(QDF_MODULE_ID_HTC)); + + hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + if (hif_ctx == NULL) { + EPPING_LOG(QDF_TRACE_LEVEL_FATAL, + "%s: error: hif_ctx = NULL", __func__); + return; + } + hif_disable_isr(hif_ctx); + hif_reset_soc(hif_ctx); + + htc_handle = cds_get_context(QDF_MODULE_ID_HTC); + if (htc_handle == NULL) { + EPPING_LOG(QDF_TRACE_LEVEL_FATAL, + "%s: error: htc_handle = NULL", __func__); + return; + } + htc_stop(htc_handle); epping_cookie_cleanup(pEpping_ctx); - htc_destroy(cds_get_context(QDF_MODULE_ID_HTC)); + htc_destroy(htc_handle); } /** |
