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

Re: [Xen-devel] [PATCH 2 of 3] xenpaging: Fix-up xenpaging tool code

To: Patrick Colp <pjcolp@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2 of 3] xenpaging: Fix-up xenpaging tool code
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Wed, 28 Jul 2010 15:00:10 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 28 Jul 2010 07:04:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <5a5bfb95a437cd860ab2.1280265686@xxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Newsgroups: chiark.mail.xen.devel
References: <patchbomb.1280265684@xxxxxxxxxxxxxxxxxx> <5a5bfb95a437cd860ab2.1280265686@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Patrick Colp writes ("[Xen-devel] [PATCH 2 of 3] xenpaging: Fix-up xenpaging 
tool code"):
>   err:
> -    if ( paging->bitmap )
> -        free(paging->bitmap);
> -    if ( paging->platform_info )
> -        free(paging->platform_info);
>      if ( paging )
> +    {
> +        if ( paging->bitmap )
> +            free(paging->bitmap);

While you're doing this, why not replace

>-+        if ( paging->bitmap )
>-+            free(paging->bitmap);
with

>++        free(paging->bitmap);

since free(0) is legal and a no-op ?

Ian.

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