From da31d09aad835766467d6a971fae1e3a208b0451 Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Fri, 17 Sep 2021 23:53:42 +0200 Subject: [PATCH] Check input device reference before using --- src/uniwill_keyboard.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uniwill_keyboard.h b/src/uniwill_keyboard.h index ae6f1eb..895350c 100644 --- a/src/uniwill_keyboard.h +++ b/src/uniwill_keyboard.h @@ -300,9 +300,10 @@ static void uniwill_write_kbd_bl_reset(void) void uniwill_event_callb(u32 code) { - if (!sparse_keymap_report_known_event(uniwill_keyboard_driver.input_device, code, 1, true)) { - TUXEDO_DEBUG("Unknown code - %d (%0#6x)\n", code, code); - } + if (uniwill_keyboard_driver.input_device != NULL) + if (!sparse_keymap_report_known_event(uniwill_keyboard_driver.input_device, code, 1, true)) { + TUXEDO_DEBUG("Unknown code - %d (%0#6x)\n", code, code); + } // Special key combination when mode change key is pressed if (code == 0xb0) {