From 460b46576ad8f418fbfca397d2b86f73da23845e Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Sat, 29 Feb 2020 11:39:32 +0100 Subject: [PATCH] hid-xpadneo: Prevent accidental fall-through If none of the inner cases matches, the case will fall-through the next outer case and may incorrectly apply mappings. Signed-off-by: Kai Krakow --- hid-xpadneo/src/hid-xpadneo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hid-xpadneo/src/hid-xpadneo.c b/hid-xpadneo/src/hid-xpadneo.c index f34ddf87..72bbf712 100644 --- a/hid-xpadneo/src/hid-xpadneo.c +++ b/hid-xpadneo/src/hid-xpadneo.c @@ -623,6 +623,7 @@ static u8 map_hid_to_input_windows(struct hid_usage *usage, EV_KEY, BTN_THUMBR}; return MAP_STATIC; } + return MAP_IGNORE; case HID_UP_GENDESK: switch (hid_usage) { case 0x30: @@ -658,6 +659,7 @@ static u8 map_hid_to_input_windows(struct hid_usage *usage, EV_KEY, BTN_MODE}; return MAP_STATIC; } + return MAP_IGNORE; } return MAP_IGNORE; @@ -731,6 +733,7 @@ static u8 map_hid_to_input_linux(struct hid_usage *usage, EV_KEY, BTN_THUMBR}; return MAP_STATIC; } + return MAP_IGNORE; case HID_UP_CONSUMER: switch (hid_usage) { case 0x223: @@ -742,6 +745,7 @@ static u8 map_hid_to_input_linux(struct hid_usage *usage, EV_KEY, BTN_SELECT}; return MAP_STATIC; } + return MAP_IGNORE; case HID_UP_GENDESK: switch (hid_usage) { case 0x30: @@ -765,6 +769,7 @@ static u8 map_hid_to_input_linux(struct hid_usage *usage, 0, 0}; return MAP_AUTO; } + return MAP_IGNORE; case HID_UP_SIMULATION: switch (hid_usage) { case 0xC4: @@ -776,6 +781,7 @@ static u8 map_hid_to_input_linux(struct hid_usage *usage, EV_ABS, ABS_Z}; return MAP_STATIC; } + return MAP_IGNORE; } return MAP_IGNORE;