diff options
author | Jiri Slaby (SUSE) <jirislaby@kernel.org> | 2023-08-16 13:55:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-22 15:58:15 +0300 |
commit | 4a8d99a409d3d194527674a896362992a171cd7b (patch) | |
tree | 4b0276f45f804c51061bf395d43811e1c8d09026 /drivers/tty/tty_buffer.c | |
parent | c26405fd289b74225b111b8f23e9e7eae1a02513 (diff) | |
download | linux-4a8d99a409d3d194527674a896362992a171cd7b.tar.xz |
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>
Diffstat (limited to 'drivers/tty/tty_buffer.c')
-rw-r--r-- | drivers/tty/tty_buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 94a88dc05a54..c101b4ab737e 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -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; |