summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bcmdhd/wifi_hal/common.cpp2
-rw-r--r--bcmdhd/wifi_hal/wifi_logger.cpp6
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;
}