Skip to content

Commit 06b19bd

Browse files
committed
ASoC: SOF: trace: Return from trace_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 5bce200 commit 06b19bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/sof/trace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ static ssize_t sof_dfsentry_trace_read(struct file *file, char __user *buffer,
331331
return -EIO;
332332
}
333333

334+
/* no new trace data */
335+
if (!avail)
336+
return 0;
337+
334338
/* make sure count is <= avail */
335339
if (count > avail)
336340
count = avail;

0 commit comments

Comments
 (0)