Re: [PATCH -next] usbip: vudc: fix missing unlock on error in usbip_sockfd_store()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux