Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3217135rwo; Mon, 24 Jul 2023 07:58:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlEsk1I8q9n5YTYCqXDD/nd7sZjeYnvg/H4HGIgpWZ8mfwHeBtYJCL4iV8L6eqVDsXlWgawu X-Received: by 2002:ac2:4897:0:b0:4fb:be3c:d8b7 with SMTP id x23-20020ac24897000000b004fbbe3cd8b7mr4677707lfc.51.1690210680388; Mon, 24 Jul 2023 07:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690210680; cv=none; d=google.com; s=arc-20160816; b=xW6blcIEDYCWaoe+r/lI7zJae+3EusLjqnXv3n7id5mUpn8hv/UCZEHIRG5pu7n4OL efMyGEFMpiGjdYlPL59lEm+Dj/JqVFxWnyjYBohOKlnB9ixvbOlmHy9CqwJByPrHM+Sy sKv/QBIt4qByu8jFwtPtxvktIn3eV1DvTRM3/Ygh+1BuFLnoHmcXwj2ZKOvdbzRFilNn gAYPeigprzA8U7EWWAsPoMrc1A8Dx54ol7fwUFBYRXgSgV2dCtkdCnlAgN4GOuDaVCQ3 Bvlrhw7hHTjefuHd2OZfxEWRnLUSyFi1b+BlVMpDBPJXl0y3x+ed5BFegRLrVc8yCzg7 oWFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=fjhqGd4xqU0yz9qCT7vFaUKIdJpqu4LYq+dCma4B0YM=; fh=KOGEnvsuAa36VBsTmQCuZxaDvaRu7Me+7moi3GeuGd8=; b=t7Pz2QK6GUrnR2AxZTFiO1Yjei+p9WXia7MRf1agXpDyC/71bpLZ87BvaiP/Iqfc9K 9/c6wCXbj+Oy+oUmdXU3FUKcjD5xAeaLREUzQMpflHgbniXPKWQcIVa0rEL2VcoYO5yY 0863TOYAxnKdMSi9h4ae+SHe28Kor9JD5kXGXx9cCuxeVQdYVhy6jncX3saLHHHYMuAx Dt3SfomUF0vkIGvnaJTqFhg3kNZlNulO69I1+9OeqtezvfC4UKKpi/h+1lhdGCjautGj 5iDkiEdXgWLmYbmoGvcuAGzCNv4WXVhsjpO4TK5FscI/XCM0JHUIO8R2PYbO0/40Eutk iJVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u3-20020aa7d983000000b00521a3e3d9d3si6302642eds.143.2023.07.24.07.57.36; Mon, 24 Jul 2023 07:58:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbjGXO0H (ORCPT + 99 others); Mon, 24 Jul 2023 10:26:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbjGXO0F (ORCPT ); Mon, 24 Jul 2023 10:26:05 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 8040CE64 for ; Mon, 24 Jul 2023 07:26:04 -0700 (PDT) Received: (qmail 1848894 invoked by uid 1000); 24 Jul 2023 10:26:03 -0400 Date: Mon, 24 Jul 2023 10:26:03 -0400 From: Alan Stern To: Michael Grzeschik Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] usb: gadget: core: remove unbalanced mutex_unlock in usb_gadget_activate Message-ID: References: <20230721222256.1743645-1-m.grzeschik@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230721222256.1743645-1-m.grzeschik@pengutronix.de> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 22, 2023 at 12:22:56AM +0200, Michael Grzeschik wrote: > Commit 286d9975a838 ("usb: gadget: udc: core: Prevent soft_connect_store() race") > introduced one extra mutex_unlock of connect_lock in the usb_gadget_active function. > > Fixes: 286d9975a838 ("usb: gadget: udc: core: Prevent soft_connect_store() race") > Signed-off-by: Michael Grzeschik > --- Hard to see how we missed that... Reviewed-by: Alan Stern Thanks! > drivers/usb/gadget/udc/core.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c > index 59188ea065e0c9..cd58f2a4e7f34d 100644 > --- a/drivers/usb/gadget/udc/core.c > +++ b/drivers/usb/gadget/udc/core.c > @@ -878,7 +878,6 @@ int usb_gadget_activate(struct usb_gadget *gadget) > */ > if (gadget->connected) > ret = usb_gadget_connect_locked(gadget); > - mutex_unlock(&gadget->udc->connect_lock); > > unlock: > mutex_unlock(&gadget->udc->connect_lock); > -- > 2.39.2 >