From patchwork Fri Mar 15 18:02:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryce Harrington X-Patchwork-Id: 2279841 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id BB282DF24C for ; Fri, 15 Mar 2013 18:04:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B59FEE6ACF for ; Fri, 15 Mar 2013 11:04:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from smtp.outflux.net (smtp.outflux.net [198.145.64.163]) by gabe.freedesktop.org (Postfix) with ESMTP id E2012E6ABE for ; Fri, 15 Mar 2013 11:03:16 -0700 (PDT) Received: from humber.bryceharrington.org (static-50-53-70-170.bvtn.or.frontiernet.net [50.53.70.170]) (authenticated bits=0) by vinyl.outflux.net (8.14.4/8.14.4/Debian-2ubuntu2) with ESMTP id r2FI36UK013852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Mar 2013 11:03:12 -0700 From: Bryce Harrington To: intel-gfx@lists.freedesktop.org, chris@chris-wilson.co.uk Date: Fri, 15 Mar 2013 11:02:52 -0700 Message-Id: <1363370578-30443-3-git-send-email-bryce@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363370578-30443-1-git-send-email-bryce@canonical.com> References: <1363370578-30443-1-git-send-email-bryce@canonical.com> X-MIMEDefang-Filter: outflux$Revision: 1.316 $ X-HELO: humber.bryceharrington.org X-Scanned-By: MIMEDefang 2.71 on 198.145.64.163 Cc: Bryce Harrington Subject: [Intel-gfx] [PATCH 2/8] xfree86: Track error code and add label for error handling. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Signed-off-by: Bryce Harrington --- hw/xfree86/os-support/linux/lnx_platform.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c index 69a5b8c..6ee219a 100644 --- a/hw/xfree86/os-support/linux/lnx_platform.c +++ b/hw/xfree86/os-support/linux/lnx_platform.c @@ -23,6 +23,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path) drmSetVersion sv; char *buf; int fd; + int err = 0; fd = open(path, O_RDWR, O_CLOEXEC); if (fd == -1) @@ -32,10 +33,10 @@ get_drm_info(struct OdevAttributes *attribs, char *path) sv.drm_di_minor = 4; sv.drm_dd_major = -1; /* Don't care */ sv.drm_dd_minor = -1; /* Don't care */ - if (drmSetInterfaceVersion(fd, &sv)) { + err = drmSetInterfaceVersion(fd, &sv); + if (err) { ErrorF("setversion 1.4 failed\n"); - close(fd); - return FALSE; + goto out; } xf86_add_platform_device(attribs); @@ -44,8 +45,9 @@ get_drm_info(struct OdevAttributes *attribs, char *path) xf86_add_platform_device_attrib(xf86_num_platform_devices - 1, ODEV_ATTRIB_BUSID, buf); drmFreeBusid(buf); +out: close(fd); - return TRUE; + return (err == 0); } Bool