From 77035a08aeda6b90573365c22c2d542dbf9808db Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 2 Sep 2015 10:36:40 -0400 Subject: [PATCH] etekcity: make sure action is valid before dereferencing it This should never happen on the Etekcity Scroll Alpha, but we might end up in a situation where this is required. Signed-off-by: Benjamin Tissoires --- src/driver-etekcity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver-etekcity.c b/src/driver-etekcity.c index 034e7642..7255a8fc 100644 --- a/src/driver-etekcity.c +++ b/src/driver-etekcity.c @@ -526,7 +526,7 @@ etekcity_read_profile(struct ratbag_profile *profile, unsigned int index) struct etekcity_macro *macro; action = etekcity_button_to_action(profile, i); - if (action->type != RATBAG_BUTTON_ACTION_TYPE_MACRO) + if (!action || action->type != RATBAG_BUTTON_ACTION_TYPE_MACRO) continue; etekcity_set_config_profile(device, index, i);