|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-devel
[Xen-devel] Re: [PATCH] XEN: Make handle_vcpu_hotplug_event() to check t
 
On 03/11/2010 06:53 PM, wzt.wzt@xxxxxxxxx wrote:
 
It seems handle_vcpu_hotplug_event() not check the sscanf() return value.
Signed-off-by: Zhitong Wang<zhitong.wangzt@xxxxxxxxxxxxxxx>
    
 
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);
        }
  }
   
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread> |  
- [Xen-devel] Re: [PATCH] XEN: Make handle_vcpu_hotplug_event() to check the sscanf() return value,
Jeremy Fitzhardinge <=
  
 |  
  
 | 
    | 
  
  
    |   | 
    |