From patchwork Fri Oct 17 17:09:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38920 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 43F14202DB for ; Fri, 17 Oct 2014 17:11:07 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id d17sf795270eek.6 for ; Fri, 17 Oct 2014 10:11:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=uo6ms79TB9c6oqi5DJE/9hcxmwLuK2lyTQmfwvlINoo=; b=bbp3+CEhL4Zpv989clKLwI4+WzKtOXUitQ00t4QV6K6mpKT7zl5dwJyTN0j1/mASEh lToQPle1e8lca2mosDVAgK447JAoqN63vrgCgyWC11uEupG9GvYvU62heprvMEw/edRK fCpFH9uKMv5MhF1F6nDvIylD6w4k6kn0VsG9BpguP1wfAbgsoOuztjIUlm1tKUjt9q0E HqGkLcj/ywl/nNVyVoP8MlUYdxiX8MOgRvO+5VI4fcv3N53pg1RPxMR3KjwO9WHFI8OJ 7xpaSa/TnWVeazh3Oiosz5x4Xi0hvIxXX55NZWyWwskO08TBzXLjvOb+U9S6FoR1KZnn UrmA== X-Gm-Message-State: ALoCoQl/hQ3UOKgM6Cx1f63fSD/Vc/lhVYPGgxYaf2zjckmGnNesJ2vBKKXZjRw/N+P7qA8+EX+Y X-Received: by 10.194.178.163 with SMTP id cz3mr1575740wjc.1.1413565866403; Fri, 17 Oct 2014 10:11:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.229 with SMTP id h5ls293132lam.4.gmail; Fri, 17 Oct 2014 10:11:06 -0700 (PDT) X-Received: by 10.152.161.231 with SMTP id xv7mr10242903lab.43.1413565866246; Fri, 17 Oct 2014 10:11:06 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id a4si2959628lbm.77.2014.10.17.10.11.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id u10so1043047lbd.1 for ; Fri, 17 Oct 2014 10:11:05 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr5582030lap.44.1413565865782; Fri, 17 Oct 2014 10:11:05 -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.84.229 with SMTP id c5csp266819lbz; Fri, 17 Oct 2014 10:11:05 -0700 (PDT) X-Received: by 10.70.127.199 with SMTP id ni7mr9845733pdb.100.1413565864346; Fri, 17 Oct 2014 10:11:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8si1689853pdo.55.2014.10.17.10.11.03 for ; Fri, 17 Oct 2014 10:11:04 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753642AbaJQRLA (ORCPT + 3 others); Fri, 17 Oct 2014 13:11:00 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:44000 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753523AbaJQRK3 (ORCPT ); Fri, 17 Oct 2014 13:10:29 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHASL0007472 for ; Fri, 17 Oct 2014 12:10:28 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHASD0023156 for ; Fri, 17 Oct 2014 12:10:28 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:10:27 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHARLn021688; Fri, 17 Oct 2014 12:10:28 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 13/28] usb: gadget: function: uac2: prevent double ep disable Date: Fri, 17 Oct 2014 12:09:49 -0500 Message-ID: <1413565804-13061-14-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413565804-13061-1-git-send-email-balbi@ti.com> References: <1413565804-13061-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 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: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 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: , without this check, f_uac2 would try to disable the same endpoint twice. Fix that. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/function/f_uac2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index fa51118..1146f4d 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -951,6 +951,9 @@ free_ep(struct uac2_rtd_params *prm, struct usb_ep *ep) struct snd_uac2_chip *uac2 = prm->uac2; int i; + if (!prm->ep_enabled) + return; + prm->ep_enabled = false; for (i = 0; i < USB_XFERS; i++) {