Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp382936pxj; Thu, 20 May 2021 11:31:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfncmr0fIfC1wUppVn+DYQ50bPHnn5GGf93rxYrNWix7Ku0Vaw8/ae3RtzCqrVXQlM6N3X X-Received: by 2002:aa7:d718:: with SMTP id t24mr6547072edq.259.1621535462448; Thu, 20 May 2021 11:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621535462; cv=none; d=google.com; s=arc-20160816; b=0Pu9fJgK6Sf6ZDrqZhFwGpu8NBAtRvBzK9s7VHrN9qG3GSycsxk78+tCmsjQ1mrM6M 7f9dcXlb89XgMVYUHrtTU4wIzo15opqvv4WFjA1Cf+mGGMTup2zppLb8f/aXVQJJfHmL AGoKAHAt9aWKJRQUC6iHS2Z4yn/ALQWSEGsfWzuICtYt8m3EJfvU3hUep0cRYJYUmPOS rCrzp9oJsLuRBwj7GsmraB7o+g9TAyfcIVTbOgJdvv+bdPa3BdVFEQXeMY671n0LcLAa MjOxd2ywYq+6N5eHNMcMnvPCCFgDwBKshuuhx0YBTUuDW7FGbIzOSLxICjg/baXqNeHN Txmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yP/s337Wqz7Ln4CKNzYxuYGZsveZ1JcN0y0ZFBsxm44=; b=CNehEN6gaTJXrJid8C57+LM1KjLAxVVYdGKsw4b2mdYt1IbtP+3qplVJQto0s+eRWX KOlCplI3FVBgGUmqZ/62ZY7dc3INMRTu2v9xw9GxPJ2rfb9o0AU3+q2uB7FNjPhnB+vm CD5vZaT1T2t2xYKjBnbQyKFjoylaRaIbRbY7yMd5w3F0mvzCxutUlBXhEb3cNSl85Owo Ql55uXH52D1Q3QYUWnGhlWvRR2dLZr49KeCNgagg7btLidi+XXOZu1vvNvs8GlSPvQqV KRL1W1gE+n8OhQyOHmzLutLaILhVKyXrsHeftZnsTPP8ITU9Ihen/JElTgNifOW/fv51 +IqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fiCldZ2e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si3796547ejj.281.2021.05.20.11.30.38; Thu, 20 May 2021 11:31:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fiCldZ2e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236625AbhETKUM (ORCPT + 99 others); Thu, 20 May 2021 06:20:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:41926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236026AbhETKKH (ORCPT ); Thu, 20 May 2021 06:10:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4902B6142D; Thu, 20 May 2021 09:43:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503782; bh=yyouw4ANJaF3nE2IJKqG0tuz2BEuU1ePiRNPEvd+2gc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fiCldZ2eN/EF9N5l9Fym0lImhkuaRa9fBp5lb/TQL1pdoziUrbEAoKHlagTnoRilF b7RljZhvnSlhwLJe8ihJ08SyxOmHDqczTSH4IrUzC2zIKC2nByodEbM4QAOJ09ffrw Hco+lsZbEuidaav0vZoHbZLBMTau3MSvYECc5wBo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wesley Cheng Subject: [PATCH 4.19 378/425] usb: dwc3: gadget: Return success always for kick transfer in ep queue Date: Thu, 20 May 2021 11:22:27 +0200 Message-Id: <20210520092143.818252662@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wesley Cheng commit 18ffa988dbae69cc6e9949cddd9606f6fe533894 upstream. If an error is received when issuing a start or update transfer command, the error handler will stop all active requests (including the current USB request), and call dwc3_gadget_giveback() to notify function drivers of the requests which have been stopped. Avoid returning an error for kick transfer during EP queue, to remove duplicate cleanup operations on the request being queued. Fixes: 8d99087c2db8 ("usb: dwc3: gadget: Properly handle failed kick_transfer") cc: stable@vger.kernel.org Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/1620410119-24971-1-git-send-email-wcheng@codeaurora.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/gadget.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1413,7 +1413,9 @@ static int __dwc3_gadget_ep_queue(struct } } - return __dwc3_gadget_kick_transfer(dep); + __dwc3_gadget_kick_transfer(dep); + + return 0; } static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,