diff options
author | Vinit Deshpande <vinitd@google.com> | 2015-07-16 22:56:38 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-16 22:56:38 +0000 |
commit | 207f0ec3e0553759771eb11d735a85cba515d8e4 (patch) | |
tree | 6caa52ef9fee5c8a4e4240f85c783833e94dc86e | |
parent | 36a87a16bcdf694a8ec38e9c35e933bd7d55e51d (diff) | |
parent | f02f545dd490b658110fb837f4905050b3ed9c52 (diff) | |
download | hardware_broadcom_wlan-207f0ec3e0553759771eb11d735a85cba515d8e4.zip hardware_broadcom_wlan-207f0ec3e0553759771eb11d735a85cba515d8e4.tar.gz hardware_broadcom_wlan-207f0ec3e0553759771eb11d735a85cba515d8e4.tar.bz2 |
am f02f545d: Fix couple of issues with unregistering event handlers
* commit 'f02f545dd490b658110fb837f4905050b3ed9c52':
Fix couple of issues with unregistering event handlers
-rw-r--r-- | bcmdhd/wifi_hal/common.cpp | 2 | ||||
-rw-r--r-- | bcmdhd/wifi_hal/wifi_logger.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/bcmdhd/wifi_hal/common.cpp b/bcmdhd/wifi_hal/common.cpp index fc81d61..f0184d6 100644 --- a/bcmdhd/wifi_hal/common.cpp +++ b/bcmdhd/wifi_hal/common.cpp @@ -180,7 +180,7 @@ WifiCommand *wifi_unregister_cmd(wifi_handle handle, int id) for (int i = 0; i < info->num_cmd; i++) { if (info->cmd[i].id == id) { cmd = info->cmd[i].cmd; - memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i) * sizeof(cmd_info)); + memmove(&info->cmd[i], &info->cmd[i+1], (info->num_cmd - i - 1) * sizeof(cmd_info)); info->num_cmd--; ALOGV("Successfully removed command %d: %p from %d", id, cmd, i); break; diff --git a/bcmdhd/wifi_hal/wifi_logger.cpp b/bcmdhd/wifi_hal/wifi_logger.cpp index 7f23df5..be1467f 100644 --- a/bcmdhd/wifi_hal/wifi_logger.cpp +++ b/bcmdhd/wifi_hal/wifi_logger.cpp @@ -458,9 +458,11 @@ public: /* Send a command to driver to stop generating logging events */ ALOGV("Clear loghandler"); + /* unregister event handler */ + unregisterVendorHandler(GOOGLE_OUI, GOOGLE_DEBUG_RING_EVENT); + WifiRequest request(familyId(), ifaceId()); int result = request.create(GOOGLE_OUI, LOGGER_RESET_LOGGING); - if (result != WIFI_SUCCESS) { ALOGE("failed to create reset request; result = %d", result); return result; @@ -472,8 +474,6 @@ public: return result; } - /* unregister event handler */ - unregisterVendorHandler(GOOGLE_OUI, GOOGLE_DEBUG_RING_EVENT); ALOGD("Success to clear loghandler"); return WIFI_SUCCESS; } |