Input: xpad - prevent spurious input from wired Xbox 360 controllers
[cascardo/linux.git] / drivers / input / joystick / xpad.c
index 39cc52f..ca62a6e 100644 (file)
@@ -457,6 +457,10 @@ static void xpad_process_packet(struct usb_xpad *xpad, u16 cmd, unsigned char *d
 static void xpad360_process_packet(struct usb_xpad *xpad, struct input_dev *dev,
                                   u16 cmd, unsigned char *data)
 {
+       /* valid pad data */
+       if (data[0] != 0x00)
+               return;
+
        /* digital pad */
        if (xpad->mapping & MAP_DPAD_TO_BUTTONS) {
                /* dpad as buttons (left, right, up, down) */