Skip to content

Commit

Permalink
hid-xpadneo: Prevent accidental fall-through
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
kakra committed May 7, 2020
1 parent df55d27 commit 460b465
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hid-xpadneo/src/hid-xpadneo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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;
Expand Down

0 comments on commit 460b465

Please sign in to comment.