summaryrefslogtreecommitdiffstats
path: root/drivers/staging/usbip
diff options
context:
space:
mode:
authorShuah Khan2014-03-25 13:47:13 +0100
committerGreg Kroah-Hartman2014-04-15 23:43:01 +0200
commitde4734bc651d19ed71ad30222aac9b1416e1bd52 (patch)
treee71fb13ae4101035196c48d9e28e3d09291b37de /drivers/staging/usbip
parentstaging/usbip: userspace - fix usbipd SIGSEGV from refresh_exported_devices() (diff)
downloadkernel-qcow2-linux-de4734bc651d19ed71ad30222aac9b1416e1bd52.tar.gz
kernel-qcow2-linux-de4734bc651d19ed71ad30222aac9b1416e1bd52.tar.xz
kernel-qcow2-linux-de4734bc651d19ed71ad30222aac9b1416e1bd52.zip
staging/usbip: fix store_attach() sscanf return value check
sscanf() parses the input buffer for four input items. However, the return value check is incorrect, as it checks for one input item instead of four which is what it is expecting in the input buffer. As a result, sscanf() will always fail even when the input buffer is correct. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r--drivers/staging/usbip/vhci_sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c
index 47bddcdde0a6..211f43f67ea2 100644
--- a/drivers/staging/usbip/vhci_sysfs.c
+++ b/drivers/staging/usbip/vhci_sysfs.c
@@ -184,7 +184,7 @@ static ssize_t store_attach(struct device *dev, struct device_attribute *attr,
* @devid: unique device identifier in a remote host
* @speed: usb device speed in a remote host
*/
- if (sscanf(buf, "%u %u %u %u", &rhport, &sockfd, &devid, &speed) != 1)
+ if (sscanf(buf, "%u %u %u %u", &rhport, &sockfd, &devid, &speed) != 4)
return -EINVAL;
usbip_dbg_vhci_sysfs("rhport(%u) sockfd(%u) devid(%u) speed(%u)\n",