]> git.baikalelectronics.ru Git - kernel.git/commit
usbip: usbip_detach: fix to check for invalid ports
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 30 May 2018 03:03:08 +0000 (21:03 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 May 2018 10:44:39 +0000 (12:44 +0200)
commit737b38f5726812b04f0b2865735c2765560c2932
treef35af44a152d48251ca76e9bbe9a28e9a4c4daae
parent431ad242bfcee709155d15227a24d42c67b88d37
usbip: usbip_detach: fix to check for invalid ports

usbip detach doesn't check for invalid ports and ports that are already
detached. It attempts to remove state file(s) without validating the port
and sends detach request to the driver for ports that are already detached.

Add check for invalid ports (port > maxports) and ports that are already
detached (status == VDEV_ST_NULL). Don't remove state files and don't send
detach request for invalid ports and ports that are already detached.

Add error and information messages that make sense.

Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/usb/usbip/src/usbip_detach.c