summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn de la Garza <john@jjdev.com>2014-03-07 03:51:59 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-07 05:31:44 +0400
commitbf988c16a3d65c853bd3eb0ec4f15a88a76a3ccd (patch)
tree5679c5db55364253dd9fc5cd7c82ef958db92029
parentd2b7f4c4293ac16d33f4da5c8e9beb6427239285 (diff)
downloadlinux-bf988c16a3d65c853bd3eb0ec4f15a88a76a3ccd.tar.xz
usbip:usbip_common.c: check return value of sscanf
Added code to check return value of sscanf. Signed-off-by: John de la Garza <john@jjdev.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/usbip/usbip_common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/usbip/usbip_common.c b/drivers/staging/usbip/usbip_common.c
index 4a2aab16b10c..2a11233d44f8 100644
--- a/drivers/staging/usbip/usbip_common.c
+++ b/drivers/staging/usbip/usbip_common.c
@@ -55,7 +55,8 @@ static ssize_t usbip_debug_store(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{
- sscanf(buf, "%lx", &usbip_debug_flag);
+ if (sscanf(buf, "%lx", &usbip_debug_flag) != 1)
+ return -EINVAL;
return count;
}
DEVICE_ATTR_RW(usbip_debug);