Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
4a8d99a4 c26405fd

+3
+3
drivers/tty/tty_buffer.c
··· 325 325 flags += space; 326 326 } else if (tb->flags) { 327 327 memset(flag_buf_ptr(tb, tb->used), flags[0], space); 328 + } else { 329 + /* tb->flags should be available once requested */ 330 + WARN_ON_ONCE(need_flags); 328 331 } 329 332 330 333 tb->used += space;