From: Ian Campbell Subject: Re: [PATCH] libxl: libxl__spawn_qdisk_backend closes fds Date: Wed, 23 Apr 2014 11:38:10 +0100 Message-ID: <1398249490.18537.20.camel@kazak.uk.xensource.com> References: <1395073963-3737-1-git-send-email-ian.jackson@eu.citrix.com> <53280CF5.9040901@citrix.com> <21288.29462.732236.333340@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21288.29462.732236.333340@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xensource.com, coverity@xenproject.org, Roger Pau =?ISO-8859-1?Q?Monn=E9?= List-Id: xen-devel@lists.xenproject.org On Tue, 2014-03-18 at 16:23 +0000, Ian Jackson wrote: > > > return; > > > > > > error: > > > assert(rc); > > > - dmss->callback(egc, dmss, rc); > > > - return; > > > + goto out; > > > > This jump backwards is kind of strange IMHO, why not just rename the > > error label to out and use it instead for both the error and non-error > > exit paths? > > That would be possible, but would lose the assert(rc). An error > handling bug elsewhere in the function, which failed to set rc, would > result in it losing the thread of control. If we don't think the > assert is important I don't mind losing it. The assert is only there to check that we jumped to error on an error, with a common exit path the assert would be a bit unnecessary I think. Ian.