Skip to content

Commit 9600623

Browse files
committed
ASoC: SOF: ipc3-dtrace: Return from dtrace_read if there is no new data available
If no new trace data is available then return immediately, there is no need to continue with the execution of the trace_read() function. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent f1feb43 commit 9600623

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sound/soc/sof/ipc3-dtrace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ static ssize_t dfsentry_dtrace_read(struct file *file, char __user *buffer,
322322
return -EIO;
323323
}
324324

325+
/* no new trace data */
326+
if (!avail)
327+
return 0;
328+
325329
/* make sure count is <= avail */
326330
if (count > avail)
327331
count = avail;

0 commit comments

Comments
 (0)