Skip to content

Commit 17a14cd

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 3e55daf commit 17a14cd

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
@@ -323,6 +323,10 @@ static ssize_t dfsentry_dtrace_read(struct file *file, char __user *buffer,
323323
return -EIO;
324324
}
325325

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

0 commit comments

Comments
 (0)