Skip to content

Commit debd209

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 d7081cb commit debd209

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
@@ -342,6 +342,10 @@ static ssize_t dfsentry_dtrace_read(struct file *file, char __user *buffer,
342342
return -EIO;
343343
}
344344

345+
/* no new trace data */
346+
if (!avail)
347+
return 0;
348+
345349
/* make sure count is <= avail */
346350
if (count > avail)
347351
count = avail;

0 commit comments

Comments
 (0)