[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 5 of 6] x86: fix memset(ptr, 0, sizeof ptr)


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Tim Deegan <tim@xxxxxxx>
  • Date: Thu, 5 Apr 2012 13:07:18 +0100
  • Delivery-date: Thu, 05 Apr 2012 12:11:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1333626954 -3600
# Node ID 5101e5ed24732919076d5285e55c7b53032749c2
# Parent  dfe9453c066f3fbfa09c847d7ec381cdc0da0f99
x86: fix memset(ptr, 0, sizeof ptr).

Signed-off-by: Tim Deegan <tim@xxxxxxx>

diff -r dfe9453c066f -r 5101e5ed2473 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c Thu Apr 05 12:55:54 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c Thu Apr 05 12:55:54 2012 +0100
@@ -73,9 +73,9 @@ amd_f10_handler(struct mc_info *mi, uint
                return NULL;
        }
 
-       memset(mc_ext, 0, sizeof(mc_ext));
+       memset(mc_ext, 0, sizeof(*mc_ext));
        mc_ext->common.type = MC_TYPE_EXTENDED;
-       mc_ext->common.size = sizeof(mc_ext);
+       mc_ext->common.size = sizeof(*mc_ext);
        mc_ext->mc_msrs = 3;
 
        mc_ext->mc_msr[0].reg = MSR_F10_MC4_MISC1;
diff -r dfe9453c066f -r 5101e5ed2473 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Thu Apr 05 12:55:54 2012 +0100
+++ b/xen/arch/x86/mm/p2m.c     Thu Apr 05 12:55:54 2012 +0100
@@ -1236,7 +1236,7 @@ bool_t p2m_mem_access_check(unsigned lon
     if ( req )
     {
         *req_ptr = req;
-        memset(req, 0, sizeof(req));
+        memset(req, 0, sizeof (mem_event_request_t));
         req->reason = MEM_EVENT_REASON_VIOLATION;
 
         /* Pause the current VCPU */

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.