From patchwork Tue Jul 7 15:24:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 50832 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8E8D5229FC for ; Tue, 7 Jul 2015 15:24:44 +0000 (UTC) Received: by wizo10 with SMTP id o10sf11059975wiz.0 for ; Tue, 07 Jul 2015 08:24:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=IG4ew91tBKLkynbt411BOQuAXu6XSrsUeICyZbOroyg=; b=eRhHnRz5k7CzfMlaHo8wN3hObdVMEPTJfn98LqjzP4rvXYFuzEm/8SSBV40Ri6whRb D/3v/bSzduDjSMQS0et0T/qbBo5WAiOm1pGWtYR+7e708tgV4q+cWEjC18GKhig1tkFk ZbkZoWZfgFW1rpfFHBHXt6Uz80pyKt5VxLYRjK++WNLjXV8dmaS4lcpFtgFRQ5W71DhP vhEKjGASZ+rVlMkebEqqM/D4476ZSvusG8Ch0wgar7Jbz5l/hVcPo78BsOLn5v1pRCVw gxqUngqoFeEhXLTVjA7JZgDVC1utm2bdEYk4uCl4p/tfQHL2b/s24wqwHKpKiZ8Xb92J Dx7w== X-Gm-Message-State: ALoCoQlBOAzzRSSD3MoC/Ps85dTg5X92gYAhaRXf7rLhA3Nb1zUgd0llaQlB/6rRY0qumz+v1P+0 X-Received: by 10.112.42.236 with SMTP id r12mr2432823lbl.2.1436282683643; Tue, 07 Jul 2015 08:24:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.197 with SMTP id ao5ls886466lac.53.gmail; Tue, 07 Jul 2015 08:24:43 -0700 (PDT) X-Received: by 10.152.44.225 with SMTP id h1mr4523377lam.5.1436282683487; Tue, 07 Jul 2015 08:24:43 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id r10si18361845lar.147.2015.07.07.08.24.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jul 2015 08:24:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labgy5 with SMTP id gy5so47790942lab.2 for ; Tue, 07 Jul 2015 08:24:43 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr4552802lbc.86.1436282683342; Tue, 07 Jul 2015 08:24:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp2464255lbb; Tue, 7 Jul 2015 08:24:41 -0700 (PDT) X-Received: by 10.68.193.232 with SMTP id hr8mr9972765pbc.145.1436282680988; Tue, 07 Jul 2015 08:24:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kl13si35231809pab.132.2015.07.07.08.24.40; Tue, 07 Jul 2015 08:24:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757569AbbGGPYi (ORCPT + 4 others); Tue, 7 Jul 2015 11:24:38 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:34957 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbbGGPYh (ORCPT ); Tue, 7 Jul 2015 11:24:37 -0400 Received: by wiga1 with SMTP id a1so260124999wig.0 for ; Tue, 07 Jul 2015 08:24:36 -0700 (PDT) X-Received: by 10.194.78.175 with SMTP id c15mr9251896wjx.136.1436282676297; Tue, 07 Jul 2015 08:24:36 -0700 (PDT) Received: from arch-late.dtvresearch.loc (a95-92-118-66.cpe.netcabo.pt. [95.92.118.66]) by mx.google.com with ESMTPSA id ju2sm34337769wid.12.2015.07.07.08.24.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jul 2015 08:24:35 -0700 (PDT) From: Rui Miguel Silva To: Felipe Balbi Cc: linux-usb@vger.kernel.org, Rui Miguel Silva Subject: [PATCH] usb: gadget: dummy_hcd: fix status in transfer Date: Tue, 7 Jul 2015 16:24:20 +0100 Message-Id: <1436282660-10905-1-git-send-email-rui.silva@linaro.org> X-Mailer: git-send-email 2.4.5 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rui.silva@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , When the request actual state is equal to lenght, besides setting the request status to done, the status variable also need to be updated. If not, the status will be EINPROGRESS and the transfer will never be set as completed. Signed-off-by: Rui Miguel Silva --- drivers/usb/gadget/udc/dummy_hcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index 181112c..f5400b8 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -1367,8 +1367,10 @@ top: /* many requests terminate without a short packet */ } else { if (req->req.length == req->req.actual - && !req->req.zero) + && !req->req.zero) { req->req.status = 0; + *status = 0; + } if (urb->transfer_buffer_length == urb->actual_length && !(urb->transfer_flags & URB_ZERO_PACKET))