Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/via viadrmums: Stop gracefully at the ...



details:   https://anonhg.NetBSD.org/src/rev/f70e648a9fdd
branches:  trunk
changeset: 1012072:f70e648a9fdd
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Jul 20 21:29:38 2020 +0000

description:
viadrmums: Stop gracefully at the end of the PCI id list.

diffstat:

 sys/external/bsd/drm2/via/via_pci.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 7dfa9d82fb69 -r f70e648a9fdd sys/external/bsd/drm2/via/via_pci.c
--- a/sys/external/bsd/drm2/via/via_pci.c       Mon Jul 20 20:56:39 2020 +0000
+++ b/sys/external/bsd/drm2/via/via_pci.c       Mon Jul 20 21:29:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: via_pci.c,v 1.3 2018/08/27 14:12:44 riastradh Exp $    */
+/*     $NetBSD: via_pci.c,v 1.4 2020/07/20 21:29:38 riastradh Exp $    */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: via_pci.c,v 1.3 2018/08/27 14:12:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_pci.c,v 1.4 2020/07/20 21:29:38 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/device.h>
@@ -70,6 +70,9 @@
        unsigned i;
 
        for (i = 0; i < __arraycount(viadrm_pci_ids); i++) {
+               if (viadrm_pci_ids[i].vendor == 0 &&
+                   viadrm_pci_ids[i].device == 0)
+                       break;
                KASSERT(viadrm_pci_ids[i].subvendor == PCI_ANY_ID);
                KASSERT(viadrm_pci_ids[i].subdevice == PCI_ANY_ID);
                KASSERT(viadrm_pci_ids[i].class == 0);



Home | Main Index | Thread Index | Old Index