usbip: vudc: fix missing unlock on error in usbip_sockfd_store()
Subsystems (3)
PATCH v2 1/1 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.
--- drivers/usb/usbip/vudc_sysfs.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/usbip/vudc_sysfs.c +2 -0
@@ -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 ; }
Signature · 1 line
2.25.4
Quoted 20 lines · Ye Bin
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 <[email protected]>Signed-off-by Ye Bin <[email protected]>--- drivers/usb/usbip/vudc_sysfs.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/usbip/vudc_sysfs.c +1
-0@@ -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);
drivers/usb/usbip/vudc_sysfs.c static ssize_t usbip_sockfd_store(struct device *dev, · line 169
Quoted 10 lines
drivers/usb/usbip/vudc_sysfs.c +1
-0return -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 ; }
Thank you for finding and fixing this.
thanks,
-- Shuah
Greg KH
maintainerQuoted 32 lines · Ye Bin
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 <[email protected]>Signed-off-by Ye Bin <[email protected]>--- drivers/usb/usbip/vudc_sysfs.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/usbip/vudc_sysfs.c +2
-0@@ -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 ; }Signature · 1 line
2.25.4
This breaks the build, are you sure you tested it???
Sorry. I build kernel image with follow config and commit base on linux-next:
commit:e99d8a849517
config: make allmodconfig
I can build kernel image without errors. So, what build error did you encounter?
Quoted 37 lines · Greg KH
Quoted 32 lines · Ye Bin
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 <[email protected]>Signed-off-by Ye Bin <[email protected]>--- drivers/usb/usbip/vudc_sysfs.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/usbip/vudc_sysfs.c +2
-0@@ -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 ; }Signature · 1 line
2.25.4This breaks the build, are you sure you tested it???
.
Greg KH
maintainerQuoted 6 lines · yebin
Sorry. I build kernel image with follow config and commit base on linux-next:
commit:e99d8a849517
config: make allmodconfig
I can build kernel image without errors. So, what build error did you encounter?
Ah, I missed that this was only in my usb-linus branch, which is now in Linus's tree, so I can take this, sorry for the noise...
greg k-h