Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00acfec5 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: gadget: f_diag: Decrement counter if zero length packet queueing fails



If usb_ep_queue() fails on queueing zero-length packet, driver is not
decrementing dpkts_tolaptop_pending counter which may results into seeing
count mismatch. Hence decrement dpkts_tolaptop_pending if zero length
packet queueing fails.

CRs-Fixed: 1027031
Change-Id: Id3c7c2627bdf37524067512db51d3180c570106d
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 48f705c3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * Diag Function Device - Route ARM9 and ARM11 DIAG messages
 * between HOST and DEVICE.
 * Copyright (C) 2007 Google, Inc.
 * Copyright (c) 2008-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
 * Author: Brian Swetland <swetland@google.com>
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
@@ -240,6 +240,7 @@ static void diag_write_complete(struct usb_ep *ep,
			/* Queue zero length packet */
			if (!usb_ep_queue(ctxt->in, req, GFP_ATOMIC))
				return;
			ctxt->dpkts_tolaptop_pending--;
		} else {
			ctxt->dpkts_tolaptop++;
		}