WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

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

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH]: Small fix in using allocate_resource() in dom0
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;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.6
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

<Prev in Thread] Current Thread [Next in Thread>