From: Greg KH <gregkh@linuxfoundation.org>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: john@jjdev.com, ced@ryick.net, devel@driverdev.osuosl.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
shuahkhan@gmail.com
Subject: Re: [PATCH] staging/usbip: fix store_attach() sscanf return value check
Date: Mon, 24 Mar 2014 17:38:54 -0700 [thread overview]
Message-ID: <20140325003854.GB10953@kroah.com> (raw)
In-Reply-To: <1395702729-3281-1-git-send-email-shuah.kh@samsung.com>
On Mon, Mar 24, 2014 at 05:12:09PM -0600, Shuah Khan wrote:
> Fix commit - 88fa1ebfa21b5deaaad2dc88ecd9f6af91796cf7
What do you mean by this line?
> 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
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2014-03-25 0:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 23:12 Shuah Khan
2014-03-25 0:38 ` Greg KH [this message]
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=20140325003854.GB10953@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ced@ryick.net \
--cc=devel@driverdev.osuosl.org \
--cc=john@jjdev.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=shuah.kh@samsung.com \
--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®