summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-11 14:36:47 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-11 14:36:47 -0800
commitdb9571a66156bfbc0273e66e5c77923869bda547 (patch)
tree513e6592025b36c461e30f84d10c1aed9982d308 /kernel
parent148f95f75c513936d466bcc7e6bf73298da2212b (diff)
parent9abbecf408cba09d73d14f044e1bc12ab7776da0 (diff)
Merge tag 'printk-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux
Pull printk updates from Petr Mladek: - Check all mandatory callbacks when registering nbcon consoles - Fix some compiler warnings * tag 'printk-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: vsnprintf: drop __printf() attributes on binary printing functions printf: convert test_hashed into macro printk: nbcon: Check for device_{lock,unlock} callbacks
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk/nbcon.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index 32fc12e53675..be5a04367e60 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -1758,9 +1758,12 @@ bool nbcon_alloc(struct console *con)
/* Synchronize the kthread start. */
lockdep_assert_console_list_lock_held();
- /* The write_thread() callback is mandatory. */
- if (WARN_ON(!con->write_thread))
+ /* Check for mandatory nbcon callbacks. */
+ if (WARN_ON(!con->write_thread ||
+ !con->device_lock ||
+ !con->device_unlock)) {
return false;
+ }
rcuwait_init(&con->rcuwait);
init_irq_work(&con->irq_work, nbcon_irq_work);