[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/4] xen/arm: optimize the size of struct vcpu




On 12/18/25 7:15 PM, Andrew Cooper wrote:
  int vcpu_vgic_free(struct vcpu *v)
  {
-    xfree(v->arch.vgic.private_irqs);
+    xfree(v->arch.vgic->private_irqs);
+    xfree(v->arch.vgic);
+
      return 0;
  }
Free functions should be idempotent.  This was buggy before, even moreso
now.

Was it really buggy before in terms of idempotent.

It seems like xfree() can handle the case when v->arch.vgic.private_irqs is 
NULL.
Should I still have:
 if ( v->arch.vgic->private_irqs )
    XFREE(v->arch.vgic->private_irqs);
?

~ Oleksii




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.