Commit 6d3e0d8c authored by John Ogness's avatar John Ogness Committed by Petr Mladek

kdb: Do not assume write() callback available

It is allowed for consoles to not provide a write() callback. For
example ttynull does this.

Check if a write() callback is available before using it.
Signed-off-by: default avatarJohn Ogness <john.ogness@linutronix.de>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Acked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20230717194607.145135-2-john.ogness@linutronix.de
parent 7ec85f3e
...@@ -576,6 +576,8 @@ static void kdb_msg_write(const char *msg, int msg_len) ...@@ -576,6 +576,8 @@ static void kdb_msg_write(const char *msg, int msg_len)
continue; continue;
if (c == dbg_io_ops->cons) if (c == dbg_io_ops->cons)
continue; continue;
if (!c->write)
continue;
/* /*
* Set oops_in_progress to encourage the console drivers to * Set oops_in_progress to encourage the console drivers to
* disregard their internal spin locks: in the current calling * disregard their internal spin locks: in the current calling
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment