diff --git a/drivers/input/input_kbd_matrix.c b/drivers/input/input_kbd_matrix.c index 2b6c11231e..095a9bb0cf 100644 --- a/drivers/input/input_kbd_matrix.c +++ b/drivers/input/input_kbd_matrix.c @@ -334,6 +334,11 @@ int input_kbd_matrix_actual_key_mask_set(const struct device *dev, return -EINVAL; } + if (cfg->actual_key_mask == NULL) { + LOG_WRN("actual-key-mask not defined for %s", dev->name); + return -EINVAL; + } + WRITE_BIT(cfg->actual_key_mask[col], row, enabled); return 0;