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

usbip: tools: Fix detach_port() invalid port error path

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>

authored by

Zongmin Zhou and committed by
Greg Kroah-Hartman
e7cd4b81 5963e078

+1
+1
tools/usb/usbip/src/usbip_detach.c
··· 68 68 } 69 69 70 70 if (!found) { 71 + ret = -1; 71 72 err("Invalid port %s > maxports %d", 72 73 port, vhci_driver->nports); 73 74 goto call_driver_close;