summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2015-07-08 17:43:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-07-08 17:43:22 +0000
commit58a0053e1d5957808dead5b93df51a02a65fc46d (patch)
tree92d6e3a6b96fcdfc04dad708fb23c6b7d0c35e70
parenteaf59b2182588ab2e921741c772070281840e89b (diff)
parent496e6ab2147ee8bae2aa93cdd13cab2f129079f4 (diff)
downloadhardware_broadcom_wlan-58a0053e1d5957808dead5b93df51a02a65fc46d.zip
hardware_broadcom_wlan-58a0053e1d5957808dead5b93df51a02a65fc46d.tar.gz
hardware_broadcom_wlan-58a0053e1d5957808dead5b93df51a02a65fc46d.tar.bz2
Merge "Fix for system crash caused by accessing memory w/o permissions" into mnc-dev
-rw-r--r--bcmdhd/wifi_hal/common.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/bcmdhd/wifi_hal/common.cpp b/bcmdhd/wifi_hal/common.cpp
index 9182114..fc81d61 100644
--- a/bcmdhd/wifi_hal/common.cpp
+++ b/bcmdhd/wifi_hal/common.cpp
@@ -213,7 +213,7 @@ void wifi_unregister_cmd(wifi_handle handle, WifiCommand *cmd)
for (int i = 0; i < info->num_cmd; i++) {
if (info->cmd[i].cmd == cmd) {
int id = info->cmd[i].id;
- 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;