Skip to content

Commit 8a9e909

Browse files
ujfalusiplbossart
authored andcommitted
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 3453dd5 commit 8a9e909

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
@@ -352,6 +352,10 @@ static ssize_t dfsentry_dtrace_read(struct file *file, char __user *buffer,
352352
return -EIO;
353353
}
354354

355+
/* no new trace data */
356+
if (!avail)
357+
return 0;
358+
355359
/* make sure count is <= avail */
356360
if (count > avail)
357361
count = avail;

0 commit comments

Comments
 (0)