hikey960: Fix debug-hifi to print the DSP logs

Bug: 64395692
Test: Manual

Change-Id: I9116ad0934d84e11cfac7420189349e8f2f151f0
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
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: