From: Shuah Khan <shuah.kh@samsung.com>
To: gregkh@linuxfoundation.org, john@jjdev.com, ced@ryick.net
Cc: Shuah Khan <shuah.kh@samsung.com>,
linux-usb@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, shuahkhan@gmail.com
Subject: [PATCH] staging/usbip: fix store_attach() sscanf return value check
Date: Mon, 24 Mar 2014 17:12:09 -0600 [thread overview]
Message-ID: <1395702729-3281-1-git-send-email-shuah.kh@samsung.com> (raw)
Fix commit - 88fa1ebfa21b5deaaad2dc88ecd9f6af91796cf7
This commit added return value check for sscanf() that 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>
---
drivers/staging/usbip/vhci_sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/usbip/vhci_sysfs.c b/drivers/staging/usbip/vhci_sysfs.c
index e098032..1ff24e9 100644
--- a/drivers/staging/usbip/vhci_sysfs.c
+++ b/drivers/staging/usbip/vhci_sysfs.c
@@ -183,7 +183,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",
--
1.7.10.4
next reply other threads:[~2014-03-24 23:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 23:12 Shuah Khan [this message]
2014-03-25 0:38 ` Greg KH
2014-03-25 2:34 ` Shuah Khan
2014-03-25 16:38 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395702729-3281-1-git-send-email-shuah.kh@samsung.com \
--to=shuah.kh@samsung.com \
--cc=ced@ryick.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=john@jjdev.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=shuahkhan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®