Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp166502pxj; Tue, 18 May 2021 00:05:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHjdFaRS9ARYm3PMer6lRZKUe9VMaxKoFzW2Ry7Bo0bbhJIlch2caQKBS2hG4E4E6kqetn X-Received: by 2002:a02:a30e:: with SMTP id q14mr4003867jai.4.1621321556534; Tue, 18 May 2021 00:05:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621321556; cv=none; d=google.com; s=arc-20160816; b=IZwfqnF9Pi9DmFV4my4YDNkEXLmHD+gXTmm7YS5GiF3JneE/3dBb9FX9jU8Q1CbV3V quYZNRINMuyYYZ/KQINYQcQb0H/pORE4/vfUiXIyzupxlEdF+9Jfj1gAipG11+S6DLX5 hfiAZ1TKdRSyyXL2CkuUKGjIg1jqBPSBzbLXFBN3PxNs/nb40FOugz/RxQVCbhDJM7+0 LSnKGDLpJMs+k4ZbMyQYpu+L4rotN1y4mB2v7QLf8mnKyqxe59MrVn/TwJy6f78jilW3 YV706wNeZnWdLwf8yofomy4XTM5i8m9+kmlPpNsOYU3BBKoFCj/Z+cm4uFr8zQ/PdC7/ wS3g== 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=p3h1AYwvuDDQPeQztkSa+dMnHxhBQR7RCYg8e0jrqlc=; b=E+6QLv81B4XD3/bV5b8o3fDZ1dg/iNAUDo0iw9KGKB3Q0MuFFWXsY378q3yriOS1Pz QEAdD9LZwlc9kj7SC1PR0lGaM92SUaqQlCx2WzPfPNDdceLg1o4McKjHvqUu8ZrVcRL+ movCBbQ38Kl5VX0bOJOYuXLerIKKhLked1u/yrur9TJhmrbxcjNu5nw9DYkPUbAEw/k6 fRGbslAdQrmIqu2eUoC9DuNZ+L/EKFiIcV63+7yvSm/toerMQQ/3wvSB8qrVEJ9/gBor SCWesP3jIm0krJ0TuTIxEjfgOW60tXg9gbZ1950Ln5/KgGd1/nXtuXZVEJyZxZ94jQqw bx8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V8uqngSZ; 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 c25si20931086iob.45.2021.05.18.00.05.05; Tue, 18 May 2021 00:05:56 -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=V8uqngSZ; 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 S241078AbhEQOwx (ORCPT + 99 others); Mon, 17 May 2021 10:52:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:54306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240065AbhEQOlX (ORCPT ); Mon, 17 May 2021 10:41:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7446961968; Mon, 17 May 2021 14:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261154; bh=G0ZouCx4KY8m+lgR/uSo9qQJuuWGppTL+4CPKntMjnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V8uqngSZM5WMUsEHHstv/JzTA9bgnj1CwSDPRzMqvU5PuWf/8A/0nBpoXqPlTfQu7 nxjmQNoarXdNN9zGDcU/FRvNO8HD7LSAJ6tv7dVR18/EhnjUpDzbvAblEXRiMgTODr jqEwDA/bKM5bZ+J5gXUkUmAfHTHQ+kPG6WX+nf7E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wesley Cheng Subject: [PATCH 5.12 315/363] usb: dwc3: gadget: Return success always for kick transfer in ep queue Date: Mon, 17 May 2021 16:03:01 +0200 Message-Id: <20210517140313.259565985@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 @@ -1676,7 +1676,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,