linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: YueHaibing <yuehaibing@huawei.com>
To: Ye Bin <yebin10@huawei.com>,
	Valentina Manea <valentina.manea.m@gmail.com>,
	Shuah Khan <shuah@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
Date: Thu, 8 Apr 2021 16:57:11 +0800	[thread overview]
Message-ID: <bf976317-2bf5-d019-bf7b-4a4ead0b1c94@huawei.com> (raw)
In-Reply-To: <20210408085033.909377-1-yebin10@huawei.com>


这种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 <hulkci@huawei.com>
> Signed-off-by: Ye Bin <yebin10@huawei.com>
> ---
>  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;
>  		}
>  
> 
> .
> 

  reply	other threads:[~2021-04-08  8:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  8:50 [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store() Ye Bin
2021-04-08  8:57 ` YueHaibing [this message]
2021-04-08  9:19   ` Greg Kroah-Hartman
2021-04-08  9:39     ` YueHaibing
2021-04-08  9:47       ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf976317-2bf5-d019-bf7b-4a4ead0b1c94@huawei.com \
    --to=yuehaibing@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hulkci@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=valentina.manea.m@gmail.com \
    --cc=yebin10@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).