Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp645896ybm; Thu, 28 May 2020 11:32:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXGkJPv3ZF/pOcP05Zhll6vi12zdGeePvPHWylmVDWzG4qsw2oiWsTJ9sciJDeeocRKtto X-Received: by 2002:a50:e808:: with SMTP id e8mr4743988edn.258.1590690765239; Thu, 28 May 2020 11:32:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590690765; cv=none; d=google.com; s=arc-20160816; b=X7+PSZM42FQ4/zfNxEfc5aErKPWECcCnEPV9HjZ8tLi+fwSb+i8WdchBV9/4RiMH4b 7dsuCnhBOr4JUnzUBhNTE+/y4eXma1Vo4f5yx6j1ZcdupLkygGEB2nZTRUl+Ivb42V1j 1cDwfhB2bHSbcLjJ+B+R461wCpRv7W4FkZ1bXnBXKYZLOKddNIisXxyoYPwNieNWMO+1 DcaYj0cGs2F2dqHcidT9oOlchrH/+8ASDTIVNdm5CW+7FDFisp9R7EvK8fmoLZ2xeOiW O987nEv46DEp+Ll+IHKPy8Kwzt4gVWbs/jOzwgizkJ2qDxba9LaD4LGrEh3QqzGZfBJt GXGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:content-transfer-encoding :mime-version:subject:from:message-id:date:dkim-signature; bh=g25V9ze74ohPST+ggoXxOW3S8I+bB+OKie14evonoQQ=; b=B/lUAeUgTTY2PM7X3nZqoV4syMSO1XMoarvObvWyzxDQIjs8o8FZ7HNh13vEN6FF99 6wZdW4uc0Ptgr2GA25ohMXSeTgqD34ufa1sp8MLWCIQcS72ZhodZ3pc0eXR9EqtThgvx Y7/7DBYxsS9plD1UFJFMhYRPv9FIfFdLGet0K7De85fhO5uPtodzj5PEORnLggz07jBr /Mn4ff1y3+EX4mdHGWYzCoCiViLcD8rOsxxYo70SaTU+7SVUOCeonqEpY0/AvzkDCwBo O22gBD2DYcLBYs2JCnStPjq/ZeXDJRpwkH8pdZn08sHpJmGnwNBge+6rNX9ZtbzH92PJ 91LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b="eBxrUA/+"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si3952770edt.523.2020.05.28.11.32.22; Thu, 28 May 2020 11:32:45 -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=@rere.qmqm.pl header.s=1 header.b="eBxrUA/+"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405830AbgE1Sae (ORCPT + 99 others); Thu, 28 May 2020 14:30:34 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:39577 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405803AbgE1Sab (ORCPT ); Thu, 28 May 2020 14:30:31 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 49Xx8N2wkvz63; Thu, 28 May 2020 20:30:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1590690629; bh=wyk1Xu6FHxs00Uj8yLfVamGMvT7czOOsTndQSx9fs8A=; h=Date:From:Subject:To:Cc:From; b=eBxrUA/+NVA3frxBWe/uNipfhphrdxrnbO+QVsyc2NKfb4EGBpJcs2UohSLpDFIhr d7Z8q4sg6xd5TxvxBazcy9UgEJYV8WRwcWauVfYz15zNWiIP0Y9TC50CFl9dMCpigz GJUcK4BIDQDLmvVwBNuEK+cScQZdRAwfd9tGuK+bRQj/DW2YQskjqt8zyjucNN8oYB GPz248JYO9lF02C+Khq/FeigGaLORj4W0jHzUOMKM11nZsZrzImKM9B4eEAh2vH3r1 +FUHviTw1zhlKhtytHgcwKSwDdM+w9TF/sE2xz9uMVLbDVHbNd67kHRq8Ke/VON9HF J5vBtQAHmYQYA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at mail Date: Thu, 28 May 2020 20:30:28 +0200 Message-Id: <237e4bc8c63680f9ce0388d35b4c34a856ed8595.1590690518.git.mirq-linux@rere.qmqm.pl> From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH] usb: gadget: f_acm: don't disable disabled EP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: Felipe Balbi , Greg Kroah-Hartman , Robert Baldyga Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make debugging real problems easier by not trying to disable an EP that was not yet enabled. Fixes: 4aab757ca44a ("usb: gadget: f_acm: eliminate abuse of ep->driver data") Signed-off-by: Michał Mirosław --- drivers/usb/gadget/function/f_acm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/function/f_acm.c b/drivers/usb/gadget/function/f_acm.c index 200596ea9557..46647bfac2ef 100644 --- a/drivers/usb/gadget/function/f_acm.c +++ b/drivers/usb/gadget/function/f_acm.c @@ -425,9 +425,11 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) /* we know alt == 0, so this is an activation or a reset */ if (intf == acm->ctrl_id) { - dev_vdbg(&cdev->gadget->dev, - "reset acm control interface %d\n", intf); - usb_ep_disable(acm->notify); + if (acm->notify->enabled) { + dev_vdbg(&cdev->gadget->dev, + "reset acm control interface %d\n", intf); + usb_ep_disable(acm->notify); + } if (!acm->notify->desc) if (config_ep_by_speed(cdev->gadget, f, acm->notify)) -- 2.20.1