Skip to content

Commit 69a41da

Browse files
committed
ASoC: SOF: logger: fix errors on copy_to_user() status
copy_to_user() returns the number of bytes that could not be copied. Testing for the return value being equal to the requested value is not correct. Treat a non-zero return as an error Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 3cb406f commit 69a41da

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sound/soc/sof/trace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static ssize_t sof_dfsentry_trace_read(struct file *file, char __user *buffer,
8686

8787
/* copy available trace data to debugfs */
8888
rem = copy_to_user(buffer, dfse->buf + lpos, count);
89-
if (rem == count)
89+
if (rem)
9090
return -EFAULT;
9191

9292
*ppos += count;

0 commit comments

Comments
 (0)