提交 8d131d88 编写于 作者: Y Ye Bin 提交者: Zheng Zengkai

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

stable inclusion
from stable-5.10.37
commit 99d2fa2daf6da877e85c0ee8dd3a3a1fc4194b64
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit 1d08ed58 ]

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

Fixes: bd8b8204 ("usbip: vudc synchronize sysfs code paths")
Reported-by: NHulk Robot <hulkci@huawei.com>
Acked-by: NShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: NYe Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20210408112305.1022247-1-yebin10@huawei.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 1795ed3b
...@@ -156,12 +156,14 @@ static ssize_t usbip_sockfd_store(struct device *dev, ...@@ -156,12 +156,14 @@ static ssize_t usbip_sockfd_store(struct device *dev,
tcp_rx = kthread_create(&v_rx_loop, &udc->ud, "vudc_rx"); tcp_rx = kthread_create(&v_rx_loop, &udc->ud, "vudc_rx");
if (IS_ERR(tcp_rx)) { if (IS_ERR(tcp_rx)) {
sockfd_put(socket); sockfd_put(socket);
mutex_unlock(&udc->ud.sysfs_lock);
return -EINVAL; return -EINVAL;
} }
tcp_tx = kthread_create(&v_tx_loop, &udc->ud, "vudc_tx"); tcp_tx = kthread_create(&v_tx_loop, &udc->ud, "vudc_tx");
if (IS_ERR(tcp_tx)) { if (IS_ERR(tcp_tx)) {
kthread_stop(tcp_rx); kthread_stop(tcp_rx);
sockfd_put(socket); sockfd_put(socket);
mutex_unlock(&udc->ud.sysfs_lock);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册