Skip to content

Commit f6d026e

Browse files
sunlimingrostedt
authored andcommitted
tracing/user_events: Fix incorrect return value for writing operation when events are disabled
The writing operation return the count of writes regardless of whether events are enabled or disabled. Switch it to return -EBADF to indicates that the event is disabled. Link: https://lkml.kernel.org/r/[email protected] Cc: [email protected] 7f5a08c ("user_events: Add minimal support for trace_event into ftrace") Acked-by: Beau Belgrave <[email protected]> Signed-off-by: sunliming <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 0113d46 commit f6d026e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/trace_events_user.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,8 @@ static ssize_t user_events_write_core(struct file *file, struct iov_iter *i)
20962096

20972097
if (unlikely(faulted))
20982098
return -EFAULT;
2099-
}
2099+
} else
2100+
return -EBADF;
21002101

21012102
return ret;
21022103
}

0 commit comments

Comments
 (0)