From: Jeremy Fitzhardinge <jeremy@goop.org>
To: wzt.wzt@gmail.com
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
jeremy@xensource.com
Subject: Re: [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value
Date: Fri, 12 Mar 2010 16:39:28 -0800 [thread overview]
Message-ID: <4B9ADEC0.60302@goop.org> (raw)
In-Reply-To: <20100312025324.GC2712@localhost.localdomain>
On 03/11/2010 06:53 PM, wzt.wzt@gmail.com wrote:
> It seems handle_vcpu_hotplug_event() not check the sscanf() return value.
>
> Signed-off-by: Zhitong Wang<zhitong.wangzt@alibaba-inc.com>
>
Good catch, thanks.
J
> ---
> drivers/xen/cpu_hotplug.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c
> index 14e2d99..99773a6 100644
> --- a/drivers/xen/cpu_hotplug.c
> +++ b/drivers/xen/cpu_hotplug.c
> @@ -69,8 +69,8 @@ static void handle_vcpu_hotplug_event(struct xenbus_watch *watch,
>
> cpustr = strstr(node, "cpu/");
> if (cpustr != NULL) {
> - sscanf(cpustr, "cpu/%u",&cpu);
> - vcpu_hotplug(cpu);
> + if (sscanf(cpustr, "cpu/%u",&cpu) == 1)
> + vcpu_hotplug(cpu);
> }
> }
>
>
prev parent reply other threads:[~2010-03-13 0:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-12 2:53 [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value wzt.wzt
2010-03-13 0:39 ` Jeremy Fitzhardinge [this message]
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=4B9ADEC0.60302@goop.org \
--to=jeremy@goop.org \
--cc=jeremy@xensource.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wzt.wzt@gmail.com \
--cc=xen-devel@lists.xensource.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;
as well as URLs for NNTP newsgroup(s).