From patchwork Sat Dec 10 05:52:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Gray X-Patchwork-Id: 9469177 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 7F6D3602F0 for ; Sat, 10 Dec 2016 05:52:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7287D283F1 for ; Sat, 10 Dec 2016 05:52:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 675E62863E; Sat, 10 Dec 2016 05:52:40 +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 365B6283F1 for ; Sat, 10 Dec 2016 05:52:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09CDC6E1B1; Sat, 10 Dec 2016 05:52:33 +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 027A36E10F for ; Sat, 10 Dec 2016 05:52:27 +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 883454a5; Sat, 10 Dec 2016 16:52:22 +1100 (AEDT) Received: from largo.jsg.id.au (localhost [127.0.0.1]) by largo.jsg.id.au (OpenSMTPD) with ESMTP id 4d5ce693; Sat, 10 Dec 2016 16:52:22 +1100 (AEDT) From: Jonathan Gray To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 3/3] xf86drm: don't fatal on per device error in drmGetDevice[s]2 Date: Sat, 10 Dec 2016 16:52:22 +1100 Message-Id: <20161210055222.43795-3-jsg@jsg.id.au> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161210055222.43795-1-jsg@jsg.id.au> References: <20161210055222.43795-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 afce8ec..2dc679a 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: