]> xenbits.xensource.com Git - xen.git/commitdiff
cpufreq: missing check of copy_from_guest()
authorTim Deegan <tim@xen.org>
Mon, 23 Sep 2013 14:23:14 +0000 (16:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 23 Sep 2013 14:23:14 +0000 (16:23 +0200)
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>
master commit: 803f9a6cdfeda64beee908576de0ad02d6b0c480
master date: 2013-09-12 17:47:08 +0100

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 )