From patchwork Mon Dec 28 05:16:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Otto X-Patchwork-Id: 7924701 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A353BEEE5 for ; Mon, 28 Dec 2015 05:21:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CE5C20263 for ; Mon, 28 Dec 2015 05:21:13 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 863B92025A for ; Mon, 28 Dec 2015 05:21:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aDQBz-0003Pe-Sq; Mon, 28 Dec 2015 05:17:59 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aDQBy-0003Oz-AP for xen-devel@lists.xen.org; Mon, 28 Dec 2015 05:17:58 +0000 Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id 86/D8-14422-506C0865; Mon, 28 Dec 2015 05:17:57 +0000 X-Env-Sender: jtotto@uwaterloo.ca X-Msg-Ref: server-12.tower-206.messagelabs.com!1451279875!12913633!1 X-Originating-IP: [129.97.128.141] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7183 invoked from network); 28 Dec 2015 05:17:56 -0000 Received: from mailservices.uwaterloo.ca (HELO minos.uwaterloo.ca) (129.97.128.141) by server-12.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Dec 2015 05:17:56 -0000 Received: from localhost.localdomain (milv-rb-1-200-147.nblk1.cyg.net [69.41.200.147]) (authenticated bits=0) by minos.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id tBS5HB0Y027204 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Mon, 28 Dec 2015 00:17:46 -0500 From: Joshua Otto To: ian.campbell@citrix.com, xen-devel@lists.xen.org Date: Mon, 28 Dec 2015 00:16:45 -0500 Message-Id: <1451279808-25264-3-git-send-email-jtotto@uwaterloo.ca> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451279808-25264-1-git-send-email-jtotto@uwaterloo.ca> References: <1450091323.16856.24.camel@citrix.com> <1451279808-25264-1-git-send-email-jtotto@uwaterloo.ca> X-UUID: 6538d6a1-d82f-42c0-a814-e51dd40d4187 Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, czylin@uwaterloo.ca, Joshua Otto , hjarmstr@uwaterloo.ca Subject: [Xen-devel] [PATCH 2/5] libxl: make GC_FREE reachable in libxl_get_scheduler() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Coverity CID 1343309 This patch preserves the multiple error paths in order to avoid meaninglessly assigning the ERROR_FAIL libxl error code to the return variable, which is of type libxl_scheduler. Signed-off-by: Joshua Otto --- tools/libxl/libxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index ca4679b..60a2509 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -5590,8 +5590,8 @@ libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx) int r = xc_sched_id(ctx->xch, (int *)&sched); if (r != 0) { LOGE(ERROR, "getting current scheduler id"); - return ERROR_FAIL; GC_FREE; + return ERROR_FAIL; } GC_FREE; return sched;