Skip to content

Commit 34c2ea6

Browse files
committed
lvgl: input: lvgl_pointer_input: fix invalid display orientation
Fixes the dereferencing of a NULL pointer when interrupts of an input device happen early in the application. Signed-off-by: Matthias Alleman <[email protected]>
1 parent 1a49b41 commit 34c2ea6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

modules/lvgl/input/lvgl_pointer_input.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ static void lvgl_pointer_process_event(struct input_event *evt, void *user_data)
3535
struct lvgl_pointer_input_data *data = dev->data;
3636
lv_display_t *disp = lv_indev_get_display(data->common_data.indev);
3737
struct lvgl_disp_data *disp_data = (struct lvgl_disp_data *)lv_display_get_user_data(disp);
38-
struct display_capabilities *cap = &disp_data->cap;
39-
lv_point_t *point = &data->common_data.pending_event.point;
38+
struct display_capabilities *cap;
39+
lv_point_t *point;
40+
41+
if(disp_data == NULL) {
42+
return;
43+
}
44+
45+
cap = &disp_data->cap;
46+
point = &data->common_data.pending_event.point;
4047

4148
switch (evt->code) {
4249
case INPUT_ABS_X:

0 commit comments

Comments
 (0)