cpufreq: missing check of copy_from_guest()
authorTim Deegan <tim@xen.org>
Thu, 12 Sep 2013 11:36:04 +0000 (12:36 +0100)
committerTim Deegan <tim@xen.org>
Thu, 12 Sep 2013 16:47:08 +0000 (17:47 +0100)
Coverity CID 1055131
Coverity CID 1055132

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/cpufreq/cpufreq.c

index 0de5d41d44cf23976ba205c596d533a133154efc..ab668847974884b5fea1c9aa4b03115952ebdda2 100644 (file)
@@ -471,8 +471,12 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in
             ret = -ENOMEM;
             goto out;
         }
-        copy_from_guest(pxpt->states, dom0_px_info->states, 
-                                      dom0_px_info->state_count);
+        if ( copy_from_guest(pxpt->states, dom0_px_info->states,
+                             dom0_px_info->state_count) )
+        {
+            ret = -EFAULT;
+            goto out;
+        }
         pxpt->state_count = dom0_px_info->state_count;
 
         if ( cpufreq_verbose )