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

[Xen-changelog] remove redundant NULL check before xfree()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] remove redundant NULL check before xfree()
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Tue, 26 Apr 2005 13:37:38 +0000
Delivery-date: Thu, 28 Apr 2005 10:02:23 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1386, 2005/04/26 14:37:38+01:00, vh249@xxxxxxxxxxxxxxxxxxxxxx

        remove redundant NULL check before xfree()
        
        Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>



 arch/x86/shadow.c    |    4 ++--
 common/dom0_ops.c    |    3 +--
 common/domain.c      |    6 ++----
 common/grant_table.c |    3 +--
 common/physdev.c     |    7 ++-----
 5 files changed, 8 insertions(+), 15 deletions(-)


diff -Nru a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c
--- a/xen/arch/x86/shadow.c     2005-04-28 06:02:41 -04:00
+++ b/xen/arch/x86/shadow.c     2005-04-28 06:02:41 -04:00
@@ -981,12 +981,12 @@
     return 0;
 
  nomem:
-    if ( (new_modes & SHM_enable) && (d->arch.shadow_ht != NULL) )
+    if ( (new_modes & SHM_enable) )
     {
         xfree(d->arch.shadow_ht);
         d->arch.shadow_ht = NULL;
     }
-    if ( (new_modes & SHM_log_dirty) && (d->arch.shadow_dirty_bitmap != NULL) )
+    if ( (new_modes & SHM_log_dirty) )
     {
         xfree(d->arch.shadow_dirty_bitmap);
         d->arch.shadow_dirty_bitmap = NULL;
diff -Nru a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c
--- a/xen/common/dom0_ops.c     2005-04-28 06:02:41 -04:00
+++ b/xen/common/dom0_ops.c     2005-04-28 06:02:41 -04:00
@@ -349,8 +349,7 @@
             if ( copy_to_user(op->u.getdomaininfo.ctxt, c, sizeof(*c)) )
                 ret = -EINVAL;
 
-            if ( c != NULL )
-                xfree(c);
+            xfree(c);
         }
 
         if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )     
diff -Nru a/xen/common/domain.c b/xen/common/domain.c
--- a/xen/common/domain.c       2005-04-28 06:02:41 -04:00
+++ b/xen/common/domain.c       2005-04-28 06:02:41 -04:00
@@ -257,8 +257,7 @@
     set_bit(DF_CONSTRUCTED, &p->d_flags);
 
  out:    
-    if ( c != NULL )
-        xfree(c);
+    xfree(c);
     return rc;
 }
 
@@ -313,8 +312,7 @@
     return 0;
 
  out:
-    if ( c != NULL )
-        xfree(c);
+    xfree(c);
     arch_free_exec_domain_struct(d->exec_domain[vcpu]);
     d->exec_domain[vcpu] = NULL;
     return rc;
diff -Nru a/xen/common/grant_table.c b/xen/common/grant_table.c
--- a/xen/common/grant_table.c  2005-04-28 06:02:41 -04:00
+++ b/xen/common/grant_table.c  2005-04-28 06:02:41 -04:00
@@ -1122,8 +1122,7 @@
  no_mem:
     if ( t != NULL )
     {
-        if ( t->active != NULL )
-            xfree(t->active);
+        xfree(t->active);
         if ( t->maptrack != NULL )
             free_xenheap_page((unsigned long)t->maptrack);
         xfree(t);
diff -Nru a/xen/common/physdev.c b/xen/common/physdev.c
--- a/xen/common/physdev.c      2005-04-28 06:02:41 -04:00
+++ b/xen/common/physdev.c      2005-04-28 06:02:41 -04:00
@@ -146,11 +146,8 @@
 {
     struct list_head *ent;
 
-    if ( d->arch.iobmp_mask != NULL )
-    {
-        xfree(d->arch.iobmp_mask);
-        d->arch.iobmp_mask = NULL;
-    }
+    xfree(d->arch.iobmp_mask);
+    d->arch.iobmp_mask = NULL;
 
     while ( (ent = d->pcidev_list.next) != &d->pcidev_list )
     {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] remove redundant NULL check before xfree(), BitKeeper Bot <=