diff options
author | Naresh Tanniru <ntanniru@codeaurora.org> | 2018-10-12 20:42:07 +0530 |
---|---|---|
committer | Naresh Tanniru <ntanniru@codeaurora.org> | 2018-10-15 17:00:56 +0530 |
commit | cb5b57891769acd7d9a8e6081c326c16e072664c (patch) | |
tree | 777f09b955fc6ce7114cc3c287934803367cdab9 /qahw_api/src/qahw_api.cpp | |
parent | 1921622b0def507510ad166b2f545ff091f5dd26 (diff) | |
parent | e1f65e84d306206a860961f662bd78060cac06b1 (diff) |
Merge e1f65e84d306206a860961f662bd78060cac06b1 on remote branch
Change-Id: I5cb17e69a3b1e4fa78b7a130cbabc8bc7b11932b
Diffstat (limited to 'qahw_api/src/qahw_api.cpp')
-rw-r--r-- | qahw_api/src/qahw_api.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/qahw_api/src/qahw_api.cpp b/qahw_api/src/qahw_api.cpp index 8967e795..cbd90410 100644 --- a/qahw_api/src/qahw_api.cpp +++ b/qahw_api/src/qahw_api.cpp @@ -1113,6 +1113,7 @@ int qahw_get_version() int qahw_unload_module(qahw_module_handle_t *hw_module) { + int rc = -EINVAL; ALOGV("%d:%s",__LINE__, __func__); if (g_binder_enabled) { if (!g_qas_died && ((g_qas_load_count > 0) && (--g_qas_load_count == 0))) { @@ -1120,7 +1121,13 @@ int qahw_unload_module(qahw_module_handle_t *hw_module) if (qas_status(qas) == -1) return -ENODEV; pthread_mutex_destroy(&list_lock); - return qas->qahw_unload_module(hw_module); + rc = qas->qahw_unload_module(hw_module); + if (g_death_notifier != NULL) { + IInterface::asBinder(qas)->unlinkToDeath(g_death_notifier); + g_death_notifier.clear(); + } + g_qas = NULL; + return rc; } else { return -ENODEV; } |