summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZongmin Zhou <zhouzongmin@kylinos.cn>2024-10-24 05:27:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-11-08 18:26:44 +0300
commit1bdd6270eaace1e54bf4881129f25232cde0f7ca (patch)
tree222a749f011af2f15d6dd0f4b2d5606e75221465
parent93bb7700b7eaeeefa0817491c55c52355e3942e0 (diff)
downloadlinux-1bdd6270eaace1e54bf4881129f25232cde0f7ca.tar.xz
usbip: tools: Fix detach_port() invalid port error path
commit e7cd4b811c9e019f5acbce85699c622b30194c24 upstream. The detach_port() doesn't return error when detach is attempted on an invalid port. Fixes: 40ecdeb1a187 ("usbip: usbip_detach: fix to check for invalid ports") Cc: stable@vger.kernel.org Reviewed-by: Hongren Zheng <i@zenithal.me> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn> Link: https://lore.kernel.org/r/20241024022700.1236660-1-min_halo@163.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--tools/usb/usbip/src/usbip_detach.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/usb/usbip/src/usbip_detach.c b/tools/usb/usbip/src/usbip_detach.c
index aec993159036..bc663ca79c74 100644
--- a/tools/usb/usbip/src/usbip_detach.c
+++ b/tools/usb/usbip/src/usbip_detach.c
@@ -68,6 +68,7 @@ static int detach_port(char *port)
}
if (!found) {
+ ret = -1;
err("Invalid port %s > maxports %d",
port, vhci_driver->nports);
goto call_driver_close;