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-devel

[Xen-devel] Re: [ PATCH 2.6.16-rc3-xen 3/3] sysfs: export Xen hypervisor

To: "Mike D. Day" <ncmike@xxxxxxxxxx>
Subject: [Xen-devel] Re: [ PATCH 2.6.16-rc3-xen 3/3] sysfs: export Xen hypervisor attributes to sysfs
From: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
Date: Wed, 22 Feb 2006 13:26:13 +0100
Cc: Greg KH <greg@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Dave Hansen <haveblue@xxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>
Delivery-date: Thu, 23 Feb 2006 10:54:42 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43FB2642.7020109@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <43FB2642.7020109@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: mutt-ng/devel-r781 (Linux)
> +static ssize_t by_show(struct kobject * kobj,
> +                    struct attribute * attr,
> +                    char * page)
> +{
> +     int err = 0;
> +     struct xen_compile_info * info =
> +             kmalloc(sizeof(struct xen_compile_info), GFP_KERNEL);
> +     if (info ) {
> +             if (0 == HYPERVISOR_xen_version(XENVER_compile_info, info))
> +                     return sprintf(page, "%s\n", info->compile_by);
> +             kfree(info);
> +     }
> +     return err;
> +}

Looks like you have a memory leak here. There's at least one more of the
same kind in your code.

Heiko

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