Input: xpad - move pending clear to the correct location
[firefly-linux-kernel-4.4.55.git] / drivers / input / joystick / xpad.c
index 0679c4143c293a3c59eca079e4bf3bc768cf902b..aff42d5e2296b4e0c91732bdea25aab05c47d315 100644 (file)
@@ -718,6 +718,7 @@ static bool xpad_prepare_next_out_packet(struct usb_xpad *xpad)
        if (packet) {
                memcpy(xpad->odata, packet->data, packet->len);
                xpad->irq_out->transfer_buffer_length = packet->len;
+               packet->pending = false;
                return true;
        }
 
@@ -757,7 +758,6 @@ static void xpad_irq_out(struct urb *urb)
        switch (status) {
        case 0:
                /* success */
-               xpad->out_packets[xpad->last_out_packet].pending = false;
                xpad->irq_out_active = xpad_prepare_next_out_packet(xpad);
                break;