From patchwork Sat Dec 17 05:09:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Gray X-Patchwork-Id: 9478867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0C0C660760 for ; Sat, 17 Dec 2016 05:10:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 004EA28576 for ; Sat, 17 Dec 2016 05:10:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7C5E2865D; Sat, 17 Dec 2016 05:10:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8ABCA28576 for ; Sat, 17 Dec 2016 05:10:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90A326E18D; Sat, 17 Dec 2016 05:10:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lechuck.jsg.id.au (jsg.id.au [210.15.216.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id 58E526E083 for ; Sat, 17 Dec 2016 05:10:00 +0000 (UTC) Received: from largo.jsg.id.au (largo.jsg.id.au [192.168.1.43]) by lechuck.jsg.id.au (OpenSMTPD) with ESMTP id ed4ff24c; Sat, 17 Dec 2016 16:09:53 +1100 (AEDT) Received: from largo.jsg.id.au (localhost [127.0.0.1]) by largo.jsg.id.au (OpenSMTPD) with ESMTP id 911c515b; Sat, 17 Dec 2016 16:09:53 +1100 (AEDT) From: Jonathan Gray To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm v2 3/3] xf86drm: don't fatal on per device error in drmGetDevice[s]2 Date: Sat, 17 Dec 2016 16:09:53 +1100 Message-Id: <20161217050953.4876-3-jsg@jsg.id.au> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161217050953.4876-1-jsg@jsg.id.au> References: <20161210055222.43795-1-jsg@jsg.id.au> <20161217050953.4876-1-jsg@jsg.id.au> Cc: emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When iterating over all the device nodes if drmProcessPciDevice() returned an error for any node the function would return an error, ignoring any valid nodes. The result of this on OpenBSD where drmProcessPciDevice() results in device nodes being opened to issue ioctls to get pci data was that data obtained from /dev/drm0 would be ignored if /dev/drm1 could not be opened. Signed-off-by: Jonathan Gray --- xf86drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xf86drm.c b/xf86drm.c index f684c017..7d7df184 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -3383,7 +3383,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device) case DRM_BUS_PCI: ret = drmProcessPciDevice(&d, node, node_type, maj, min, true, flags); if (ret) - goto free_devices; + continue; break; default: @@ -3514,7 +3514,7 @@ int drmGetDevices2(uint32_t flags, drmDevicePtr devices[], int max_devices) ret = drmProcessPciDevice(&device, node, node_type, maj, min, devices != NULL, flags); if (ret) - goto free_devices; + continue; break; default: