From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:52355 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935165AbcIEQsd (ORCPT ); Mon, 5 Sep 2016 12:48:33 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian E Rogers , Felipe Balbi Subject: [PATCH 4.7 035/143] usb: dwc3: gadget: always cleanup all TRBs Date: Mon, 5 Sep 2016 18:43:31 +0200 Message-Id: <20160905164432.116292349@linuxfoundation.org> In-Reply-To: <20160905164430.593075551@linuxfoundation.org> References: <20160905164430.593075551@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 4.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felipe Balbi commit 7c705dfe2ebe731c8fd068623b6b4df2d3512c08 upstream. If we stop earlier due to short packet, we will not be able to giveback all TRBs. Cc: Brian E Rogers Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1969,7 +1969,7 @@ static int __dwc3_cleanup_done_trbs(stru s_pkt = 1; } - if (s_pkt) + if (s_pkt && !chain) return 1; if ((event->status & DEPEVT_STATUS_LST) && (trb->ctrl & (DWC3_TRB_CTRL_LST |