From mboxrd@z Thu Jan 1 00:00:00 1970 From: wzt.wzt@gmail.com Subject: [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value Date: Fri, 12 Mar 2010 10:53:24 +0800 Message-ID: <20100312025324.GC2712@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: xen-devel@lists.xensource.com, jeremy@xensource.com List-Id: xen-devel@lists.xenproject.org It seems handle_vcpu_hotplug_event() not check the sscanf() return value. Signed-off-by: Zhitong Wang --- 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); } } -- 1.6.5.3