mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
tracing/user_events: Fix incorrect return value for writing operation when events are disabled
commitf6d026eea3upstream. 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.org7f5a08c79d("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a4336343ea
commit
5aea2ac374
@@ -1456,7 +1456,8 @@ static ssize_t user_events_write_core(struct file *file, struct iov_iter *i)
|
||||
|
||||
if (unlikely(faulted))
|
||||
return -EFAULT;
|
||||
}
|
||||
} else
|
||||
return -EBADF;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user