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

[Xen-ia64-devel] [PATCH]: Small fix in using allocate_resource() in dom0


  • To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
  • From: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 29 May 2007 08:54:02 +0200
  • Delivery-date: Mon, 28 May 2007 23:54:59 -0700
  • Domainkey-signature: s=s768; d=fujitsu-siemens.com; c=nofws; q=dns; b=VoxNAkx1rKmcjTlkDwJFVn08Dj8nBjzt7O6RwWqaPnSdajPhVBTnAJgCh69vTvWl8CemWByuJo5sQob+eG+PJ943q1yJWrf53RONiCyXtDwNQkjLFp5pVN60Jp3WXTsT;
  • List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>

Hi,

while using xen_ia64_allocate_resource() for mapping domU memory into dom0  I
got dom0-panic's from time to time when executing 'cat /proc/iomem'.
I tracked this down to a not cleared kmalloced resource before using it in
allocate_resource().
Thanks.

Dietmar


# HG changeset patch
# User dietmar.hahn@xxxxxxxxxxxxxxxxxxx
# Date 1180420468 -7200
# Node ID 1a4de9e4a63756354a695528468145d1426db422
# Parent  2b14a1f22eecc73807578ceb78fa994449911d8b
The resource structure has to be cleared before using it in allocate_resource().

Signed-off-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>

diff -r 2b14a1f22eec -r 1a4de9e4a637 
linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Fri May 25 09:43:21 
2007 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Tue May 29 08:34:28 
2007 +0200
@@ -1208,7 +1208,7 @@ xen_ia64_allocate_resource(unsigned long
        struct resource* res;
        int error;
        
-       res = kmalloc(sizeof(*res), GFP_KERNEL);
+       res = kzalloc(sizeof(*res), GFP_KERNEL);
        if (res == NULL)
                return ERR_PTR(-ENOMEM);
 

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel


 


Rackspace

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