--- src/joystick/linux/SDL_sysjoystick.c.org
+++ src/joystick/linux/SDL_sysjoystick.c
@@ -1106,6 +1106,10 @@ static __inline__ void EV_HandleEvents(S
 				}
 				break;
 			    case EV_ABS:
+				if (code >= ABS_MISC) {
+				    break;
+				}
+
 				switch (code) {
 				    case ABS_HAT0X:
 				    case ABS_HAT0Y:
