Jennifer Herbert writes ("[Xen-devel] [PATCH 5/7] libxc: Removing dead code 
from xc_dom_allocate()"):
> The only place that jumps to 'err:' does so because !dom, which is
> rechecked in 'err:'.  This patch simplifies, giving the same result.

I'm not particularly convinced by this change, but maybe Ian Campbell
disagrees.

I presume that your Coverity instance is complaining about the fact
that the if (dom) clause's test is always false.  This is true with
the current code, but if this function were to gain any other code it
might stop being true and the first thing to do to get a good error
handling pattern would be to revert this patch.

However: If we're doing teh `initialise everything; single goto for
error paths; dispose of everything' error handling pattern, dom ought
to be initialised to NULL.

Ian C, what do you think ?

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to