From: Wei Liu Subject: Re: [PATCH for-4.6] libxl: fix libxl__build_hvm error code return path Date: Tue, 11 Aug 2015 14:58:17 +0100 Message-ID: <20150811135817.GM7460@zion.uk.xensource.com> References: <1439300892-6836-1-git-send-email-wei.liu2@citrix.com> <1439301341.9747.254.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZPA4f-0007Ev-Q4 for xen-devel@lists.xenproject.org; Tue, 11 Aug 2015 13:58:41 +0000 Content-Disposition: inline In-Reply-To: <1439301341.9747.254.camel@citrix.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 Campbell Cc: xen-devel@lists.xenproject.org, Roger Pau Monne , Wei Liu , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, Aug 11, 2015 at 02:55:41PM +0100, Ian Campbell wrote: > On Tue, 2015-08-11 at 14:48 +0100, Wei Liu wrote: > > In 25652f23 ("tools/libxl: detect and avoid conflicts with RDM"), new > > code was added to use rc to store libxl function call return value, > > which complied to libxl coding style. That patch, however, didn't change > > other locations where return value was stored in ret. In the end > > libxl__build_hvm could return 0 when it failed. > > > > Explicitly set rc to ERROR_FAIL in all error paths to fix this. > > > > Signed-off-by: Wei Liu > > You missed the path from libxl__domain_firmware, which incorrectly relies > on rc being already initialised by the declaration (which per CODING_STYLE > ought to be removed too). > > However perhaps you prefer to leave those other two hunks until 4.7 and > this patch is at least an improvement of sorts so: > Yes. Roger already has a patch for 4.7 to fix error handling in this function. > Acked-by: Ian Campbell Thanks