[PATCH 3/7] drivers: tty: Check CON_SUSPENDED instead of CON_ENABLED

Marcos Paulo de Souza
2025-06-07T02:54:17Z

All consoles found on for_each_console are registered, meaning that all of
them are CON_ENABLED. The code tries to find an active console, so check if the
console is not suspended instead.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
drivers/tty/tty_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index ca9b7d7bad2b6807b29d3768bb655528ea162816..42f81573d8dfc668b38cd0b1c14962a7370cd954 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3570,7 +3570,7 @@ static ssize_t show_cons_active(struct device *dev,
continue;
if (!(c->flags & CON_NBCON) && !c->write)
continue;
- if ((c->flags & CON_ENABLED) == 0)
+ if (c->flags & CON_SUSPENDED)
continue;
cs[i++] = c;
if (i >= ARRAY_SIZE(cs))

--
2.49.0