aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYe Bin <yebin10@huawei.com>2021-04-08 19:23:05 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 09:50:19 +0200
commit99d2fa2daf6da877e85c0ee8dd3a3a1fc4194b64 (patch)
tree5c41951be7eab25932781e47a3bb24c5a7e40004
parent99a29899e3a3bf62fbffbdf2d0c6b2d8efc12f65 (diff)
downloadkernel_replicant_linux-99d2fa2daf6da877e85c0ee8dd3a3a1fc4194b64.tar.gz
kernel_replicant_linux-99d2fa2daf6da877e85c0ee8dd3a3a1fc4194b64.tar.bz2
kernel_replicant_linux-99d2fa2daf6da877e85c0ee8dd3a3a1fc4194b64.zip
usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
[ Upstream commit 1d08ed588c6a85a35a24c82eb4cf0807ec2b366a ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/usb/usbip/vudc_sysfs.c2
1 files changed, 2 insertions, 0 deletions
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;
}