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

Change-Id: Ib4dbef8d7e2d7211945faf0c8ca82c65050df916
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: