mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-17 07:54:54 +08:00
tty: tty_buffer: warn if losing flags in __tty_insert_flip_string_flags()
And add a WARN_ON_ONCE(need_flags) to make sure we are not losing flags in __tty_insert_flip_string_flags(). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230816105530.3335-5-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c26405fd28
commit
4a8d99a409
@ -325,6 +325,9 @@ int __tty_insert_flip_string_flags(struct tty_port *port, const u8 *chars,
|
||||
flags += space;
|
||||
} else if (tb->flags) {
|
||||
memset(flag_buf_ptr(tb, tb->used), flags[0], space);
|
||||
} else {
|
||||
/* tb->flags should be available once requested */
|
||||
WARN_ON_ONCE(need_flags);
|
||||
}
|
||||
|
||||
tb->used += space;
|
||||
|
Loading…
Reference in New Issue
Block a user