direct-io.hg

changeset 4660:fe711d5cee02

bitkeeper revision 1.1386 (426e4422Fnf4uJoD_xnCwL17Xg94aA)

remove redundant NULL check before xfree()

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vh249@arcadians.cl.cam.ac.uk
date Tue Apr 26 13:37:38 2005 +0000 (2005-04-26)
parents 97d3b54f6d13
children 5b4ab00d85d1
files xen/arch/x86/shadow.c xen/common/dom0_ops.c xen/common/domain.c xen/common/grant_table.c xen/common/physdev.c
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Tue Apr 26 09:31:16 2005 +0000
     1.2 +++ b/xen/arch/x86/shadow.c	Tue Apr 26 13:37:38 2005 +0000
     1.3 @@ -981,12 +981,12 @@ int __shadow_mode_enable(struct domain *
     1.4      return 0;
     1.5  
     1.6   nomem:
     1.7 -    if ( (new_modes & SHM_enable) && (d->arch.shadow_ht != NULL) )
     1.8 +    if ( (new_modes & SHM_enable) )
     1.9      {
    1.10          xfree(d->arch.shadow_ht);
    1.11          d->arch.shadow_ht = NULL;
    1.12      }
    1.13 -    if ( (new_modes & SHM_log_dirty) && (d->arch.shadow_dirty_bitmap != NULL) )
    1.14 +    if ( (new_modes & SHM_log_dirty) )
    1.15      {
    1.16          xfree(d->arch.shadow_dirty_bitmap);
    1.17          d->arch.shadow_dirty_bitmap = NULL;
     2.1 --- a/xen/common/dom0_ops.c	Tue Apr 26 09:31:16 2005 +0000
     2.2 +++ b/xen/common/dom0_ops.c	Tue Apr 26 13:37:38 2005 +0000
     2.3 @@ -349,8 +349,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     2.4              if ( copy_to_user(op->u.getdomaininfo.ctxt, c, sizeof(*c)) )
     2.5                  ret = -EINVAL;
     2.6  
     2.7 -            if ( c != NULL )
     2.8 -                xfree(c);
     2.9 +            xfree(c);
    2.10          }
    2.11  
    2.12          if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )     
     3.1 --- a/xen/common/domain.c	Tue Apr 26 09:31:16 2005 +0000
     3.2 +++ b/xen/common/domain.c	Tue Apr 26 13:37:38 2005 +0000
     3.3 @@ -257,8 +257,7 @@ int set_info_guest(struct domain *p, dom
     3.4      set_bit(DF_CONSTRUCTED, &p->d_flags);
     3.5  
     3.6   out:    
     3.7 -    if ( c != NULL )
     3.8 -        xfree(c);
     3.9 +    xfree(c);
    3.10      return rc;
    3.11  }
    3.12  
    3.13 @@ -313,8 +312,7 @@ long do_boot_vcpu(unsigned long vcpu, fu
    3.14      return 0;
    3.15  
    3.16   out:
    3.17 -    if ( c != NULL )
    3.18 -        xfree(c);
    3.19 +    xfree(c);
    3.20      arch_free_exec_domain_struct(d->exec_domain[vcpu]);
    3.21      d->exec_domain[vcpu] = NULL;
    3.22      return rc;
     4.1 --- a/xen/common/grant_table.c	Tue Apr 26 09:31:16 2005 +0000
     4.2 +++ b/xen/common/grant_table.c	Tue Apr 26 13:37:38 2005 +0000
     4.3 @@ -1122,8 +1122,7 @@ grant_table_create(
     4.4   no_mem:
     4.5      if ( t != NULL )
     4.6      {
     4.7 -        if ( t->active != NULL )
     4.8 -            xfree(t->active);
     4.9 +        xfree(t->active);
    4.10          if ( t->maptrack != NULL )
    4.11              free_xenheap_page((unsigned long)t->maptrack);
    4.12          xfree(t);
     5.1 --- a/xen/common/physdev.c	Tue Apr 26 09:31:16 2005 +0000
     5.2 +++ b/xen/common/physdev.c	Tue Apr 26 13:37:38 2005 +0000
     5.3 @@ -146,11 +146,8 @@ void physdev_destroy_state(struct domain
     5.4  {
     5.5      struct list_head *ent;
     5.6  
     5.7 -    if ( d->arch.iobmp_mask != NULL )
     5.8 -    {
     5.9 -        xfree(d->arch.iobmp_mask);
    5.10 -        d->arch.iobmp_mask = NULL;
    5.11 -    }
    5.12 +    xfree(d->arch.iobmp_mask);
    5.13 +    d->arch.iobmp_mask = NULL;
    5.14  
    5.15      while ( (ent = d->pcidev_list.next) != &d->pcidev_list )
    5.16      {