hikey960: Fix debug-hifi to print the DSP logs am: 06a976ae2e am: a2bd650496 am: e132328ca9
am: 3e82b4ebb2

Change-Id: I96075d01fd9733b7d56e0e51cb4a00c4451d6e06
diff --git a/hifi/debug-hifi/debug-hifi.c b/hifi/debug-hifi/debug-hifi.c
index 5e1fcd8..75bda4c 100644
--- a/hifi/debug-hifi/debug-hifi.c
+++ b/hifi/debug-hifi/debug-hifi.c
@@ -57,10 +57,10 @@
     dump_buf.buf_size = memsize;
     dump_buf.clear = clear;
     ret = ioctl(hifi_dsp_fd, HIFI_MISC_IOCTL_DISPLAY_MSG, &dump_buf);
-    if (ret) {
+    if (ret < 0) { /* This IOCTL returns buffer size */
         ALOGE("Error %d accessing message buffer", errno);
     } else {
-        printf("%s\n", buffer);
+        printf("%s\n", ret > 0 ? buffer : "Buffer is empty");
     }
     free(buffer);
 out0: