Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usbip: vudc: fix missing unlock on error in usbip_sockfd_store()

Add the missing unlock before return from function usbip_sockfd_store()
in the error handling case.

Fixes: bd8b82042269 ("usbip: vudc synchronize sysfs code paths")
Reported-by: Hulk Robot <hulkci@huawei.com>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408112305.1022247-1-yebin10@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ye Bin and committed by
Greg Kroah-Hartman
1d08ed58 14d34d2d

+2
+2
drivers/usb/usbip/vudc_sysfs.c
··· 156 156 tcp_rx = kthread_create(&v_rx_loop, &udc->ud, "vudc_rx"); 157 157 if (IS_ERR(tcp_rx)) { 158 158 sockfd_put(socket); 159 + mutex_unlock(&udc->ud.sysfs_lock); 159 160 return -EINVAL; 160 161 } 161 162 tcp_tx = kthread_create(&v_tx_loop, &udc->ud, "vudc_tx"); 162 163 if (IS_ERR(tcp_tx)) { 163 164 kthread_stop(tcp_rx); 164 165 sockfd_put(socket); 166 + mutex_unlock(&udc->ud.sysfs_lock); 165 167 return -EINVAL; 166 168 } 167 169