Merge "WiFi-HAL: Donot dump empty vendor data buffer" into nyc-mr1-dev
diff --git a/qcwcn/wifi_hal/common.cpp b/qcwcn/wifi_hal/common.cpp
index 68b9130..324363c 100644
--- a/qcwcn/wifi_hal/common.cpp
+++ b/qcwcn/wifi_hal/common.cpp
@@ -243,24 +243,29 @@
 {
     int i=0;
     char *bytes = (char *)buf;
-    ALOGV("******HexDump len:%d*********", len);
-    for (i = 0; ((i + 7) < len); i+=8) {
-        ALOGV("%02x %02x %02x %02x   %02x %02x %02x %02x",
-              bytes[i], bytes[i+1],
-              bytes[i+2], bytes[i+3],
-              bytes[i+4], bytes[i+5],
-              bytes[i+6], bytes[i+7]);
+
+    if (len) {
+        ALOGV("******HexDump len:%d*********", len);
+        for (i = 0; ((i + 7) < len); i+=8) {
+            ALOGV("%02x %02x %02x %02x   %02x %02x %02x %02x",
+                bytes[i], bytes[i+1],
+                bytes[i+2], bytes[i+3],
+                bytes[i+4], bytes[i+5],
+                bytes[i+6], bytes[i+7]);
+        }
+        if ((len - i) >= 4) {
+            ALOGV("%02x %02x %02x %02x",
+                bytes[i], bytes[i+1],
+                bytes[i+2], bytes[i+3]);
+            i+=4;
+        }
+        for (;i < len;i++) {
+            ALOGV("%02x", bytes[i]);
+        }
+        ALOGV("******HexDump End***********");
+    } else {
+        return;
     }
-    if ((len - i) >= 4) {
-        ALOGV("%02x %02x %02x %02x",
-              bytes[i], bytes[i+1],
-              bytes[i+2], bytes[i+3]);
-        i+=4;
-    }
-    for (;i < len;i++) {
-        ALOGV("%02x", bytes[i]);
-    }
-    ALOGV("******HexDump End***********");
 }
 
 /* Firmware sends RSSI value without noise floor.