From patchwork Fri Jul 28 08:51:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 707929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2B4DC001E0 for ; Fri, 28 Jul 2023 08:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234365AbjG1Izu (ORCPT ); Fri, 28 Jul 2023 04:55:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234426AbjG1IzW (ORCPT ); Fri, 28 Jul 2023 04:55:22 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86C752D47 for ; Fri, 28 Jul 2023 01:54:21 -0700 (PDT) Received: from dggpemm100019.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RC1cR4Gfzz1GDMp; Fri, 28 Jul 2023 16:52:55 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm100019.china.huawei.com (7.185.36.251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 28 Jul 2023 16:53:50 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 28 Jul 2023 16:53:50 +0800 From: Yang Yingliang To: CC: , , Subject: [PATCH -next] usb: gadget: midi2: fix missing unlock in f_midi2_block_opts_create() Date: Fri, 28 Jul 2023 16:51:20 +0800 Message-ID: <20230728085120.3192474-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org In the error path in f_midi2_block_opts_create(), mutex_unlock() is missed, fix it by move the unlock after 'out' label. Fixes: 29ee7a4dddd5 ("usb: gadget: midi2: Add configfs support") Signed-off-by: Yang Yingliang Reviewed-by: Takashi Iwai --- drivers/usb/gadget/function/f_midi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_midi2.c b/drivers/usb/gadget/function/f_midi2.c index f1c47753e0c1..5a971ba600fe 100644 --- a/drivers/usb/gadget/function/f_midi2.c +++ b/drivers/usb/gadget/function/f_midi2.c @@ -2350,8 +2350,8 @@ static int f_midi2_block_opts_create(struct f_midi2_ep_opts *ep_opts, ep_opts->blks[blk] = block_opts; *block_p = block_opts; - mutex_unlock(&ep_opts->opts->lock); out: + mutex_unlock(&ep_opts->opts->lock); return ret; }