Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
@ 2021-04-08  8:50 Ye Bin
  2021-04-08  8:57 ` YueHaibing
  0 siblings, 1 reply; 5+ messages in thread
From: Ye Bin @ 2021-04-08  8:50 UTC (permalink / raw)
  To: yebin10, Valentina Manea, Shuah Khan, Greg Kroah-Hartman
  Cc: linux-usb, kernel-janitors, Hulk Robot

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;
 		}
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
  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
  2021-04-08  9:19   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: YueHaibing @ 2021-04-08  8:57 UTC (permalink / raw)
  To: Ye Bin, Valentina Manea, Shuah Khan, Greg Kroah-Hartman
  Cc: linux-usb, kernel-janitors, Hulk Robot


这种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;
>  		}
>  
> 
> .
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
  2021-04-08  8:57 ` YueHaibing
@ 2021-04-08  9:19   ` Greg Kroah-Hartman
  2021-04-08  9:39     ` YueHaibing
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-08  9:19 UTC (permalink / raw)
  To: YueHaibing
  Cc: Ye Bin, Valentina Manea, Shuah Khan, linux-usb, kernel-janitors,
	Hulk Robot

On Thu, Apr 08, 2021 at 04:57:11PM +0800, YueHaibing wrote:
> 
> 这种bugfix最好加下Fixes tag

I am sorry but I can not parse that :(

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
  2021-04-08  9:19   ` Greg Kroah-Hartman
@ 2021-04-08  9:39     ` YueHaibing
  2021-04-08  9:47       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: YueHaibing @ 2021-04-08  9:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Ye Bin, Valentina Manea, Shuah Khan, linux-usb, kernel-janitors,
	Hulk Robot

On 2021/4/8 17:19, Greg Kroah-Hartman wrote:
> On Thu, Apr 08, 2021 at 04:57:11PM +0800, YueHaibing wrote:
>>
>> 这种bugfix最好加下Fixes tag
> 
> I am sorry but I can not parse that :(

Sorry, I just suggest to add this Fixes tag

Fixes: bd8b82042269 ("usbip: vudc synchronize sysfs code paths")

> .
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
  2021-04-08  9:39     ` YueHaibing
@ 2021-04-08  9:47       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-08  9:47 UTC (permalink / raw)
  To: YueHaibing
  Cc: Ye Bin, Valentina Manea, Shuah Khan, linux-usb, kernel-janitors,
	Hulk Robot

On Thu, Apr 08, 2021 at 05:39:06PM +0800, YueHaibing wrote:
> On 2021/4/8 17:19, Greg Kroah-Hartman wrote:
> > On Thu, Apr 08, 2021 at 04:57:11PM +0800, YueHaibing wrote:
> >>
> >> 这种bugfix最好加下Fixes tag
> > 
> > I am sorry but I can not parse that :(
> 
> Sorry, I just suggest to add this Fixes tag
> 
> Fixes: bd8b82042269 ("usbip: vudc synchronize sysfs code paths")

Yes, that would be great to have added, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-04-08  9:19   ` Greg Kroah-Hartman
2021-04-08  9:39     ` YueHaibing
2021-04-08  9:47       ` Greg Kroah-Hartman

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git