tracing/user_events: Fix incorrect return value for writing operation when events...
authorsunliming <sunliming@kylinos.cn>
Mon, 26 Jun 2023 11:13:42 +0000 (19:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jul 2023 11:49:32 +0000 (13:49 +0200)
commit5aea2ac374560ee9bb13e32f4c06143fe95d330d
tree33020b9040a42aea501ca8515a216df4550e5d14
parenta4336343ea36540760b68cd71ea0864ca7ad3e98
tracing/user_events: Fix incorrect return value for writing operation when events are disabled

commit f6d026eea390d59787a6cdc2ef5c983d02e029d0 upstream.

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/20230626111344.19136-2-sunliming@kylinos.cn
Cc: stable@vger.kernel.org
7f5a08c79df35 ("user_events: Add minimal support for trace_event into ftrace")
Acked-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: sunliming <sunliming@kylinos.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_events_user.c