Check input device reference before using

This commit is contained in:
Christoffer Sandberg 2021-09-17 23:53:42 +02:00
parent 4fa915fcc3
commit da31d09aad

View file

@ -300,9 +300,10 @@ static void uniwill_write_kbd_bl_reset(void)
void uniwill_event_callb(u32 code) void uniwill_event_callb(u32 code)
{ {
if (!sparse_keymap_report_known_event(uniwill_keyboard_driver.input_device, code, 1, true)) { if (uniwill_keyboard_driver.input_device != NULL)
TUXEDO_DEBUG("Unknown code - %d (%0#6x)\n", code, 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);
}
// Special key combination when mode change key is pressed // Special key combination when mode change key is pressed
if (code == 0xb0) { if (code == 0xb0) {