From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39059C433ED for ; Thu, 8 Apr 2021 08:57:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1119E610CF for ; Thu, 8 Apr 2021 08:57:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbhDHI5c (ORCPT ); Thu, 8 Apr 2021 04:57:32 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15178 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbhDHI5a (ORCPT ); Thu, 8 Apr 2021 04:57:30 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FGFSR5792zpWTl; Thu, 8 Apr 2021 16:54:31 +0800 (CST) Received: from [10.174.179.96] (10.174.179.96) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 16:57:11 +0800 Subject: Re: [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store() To: Ye Bin , Valentina Manea , Shuah Khan , "Greg Kroah-Hartman" CC: , , Hulk Robot References: <20210408085033.909377-1-yebin10@huawei.com> From: YueHaibing Message-ID: Date: Thu, 8 Apr 2021 16:57:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210408085033.909377-1-yebin10@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.96] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 这种bugfix最好加下Fixes tag On 2021/4/8 16:50, Ye Bin wrote: > Add the missing unlock before return from function usbip_sockfd_store() > in the error handling case. > > Reported-by: Hulk Robot > Signed-off-by: Ye Bin > --- > drivers/usb/usbip/vudc_sysfs.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/usbip/vudc_sysfs.c b/drivers/usb/usbip/vudc_sysfs.c > index f7633ee655a1..d1cf6b51bf85 100644 > --- a/drivers/usb/usbip/vudc_sysfs.c > +++ b/drivers/usb/usbip/vudc_sysfs.c > @@ -156,12 +156,14 @@ static ssize_t usbip_sockfd_store(struct device *dev, > tcp_rx = kthread_create(&v_rx_loop, &udc->ud, "vudc_rx"); > if (IS_ERR(tcp_rx)) { > sockfd_put(socket); > + mutex_unlock(&udc->ud.sysfs_lock); > return -EINVAL; > } > tcp_tx = kthread_create(&v_tx_loop, &udc->ud, "vudc_tx"); > if (IS_ERR(tcp_tx)) { > kthread_stop(tcp_rx); > sockfd_put(socket); > + mutex_unlock(&udc->ud.sysfs_lock); > return -EINVAL; > } > > > . >