Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/shark/ofw Filter configuration space at and above P...



details:   https://anonhg.NetBSD.org/src/rev/42254d380cd9
branches:  trunk
changeset: 821847:42254d380cd9
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Feb 19 14:34:40 2017 +0000

description:
Filter configuration space at and above PCI_CONF_SIZE, instead of KASSERTing.

diffstat:

 sys/arch/shark/ofw/vlpci.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 8a8ece5ce3d9 -r 42254d380cd9 sys/arch/shark/ofw/vlpci.c
--- a/sys/arch/shark/ofw/vlpci.c        Sun Feb 19 13:58:42 2017 +0000
+++ b/sys/arch/shark/ofw/vlpci.c        Sun Feb 19 14:34:40 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vlpci.c,v 1.2 2017/02/18 13:56:29 flxd Exp $   */
+/*     $NetBSD: vlpci.c,v 1.3 2017/02/19 14:34:40 jakllsch Exp $       */
 
 /*
  * Copyright (c) 2017 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vlpci.c,v 1.2 2017/02/18 13:56:29 flxd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vlpci.c,v 1.3 2017/02/19 14:34:40 jakllsch Exp $");
 
 #include "opt_pci.h"
 #include "pci.h"
@@ -179,7 +179,9 @@
        pcireg_t ret;
 
        KASSERT((offset & 3) == 0);
-       KASSERT(offset < 0x100);
+
+       if (offset >= PCI_CONF_SIZE)
+               return 0xffffffff;
 
        mutex_spin_enter(&sc->sc_lock);
        bus_space_write_4(&isa_io_bs_tag, sc->sc_conf_ioh, 0,
@@ -201,7 +203,9 @@
        struct vlpci_softc * const sc = v;
 
        KASSERT((offset & 3) == 0);
-       KASSERT(offset < 0x100);
+
+       if (offset >= PCI_CONF_SIZE)
+               return;
 
 #if 0
        device_printf(sc->sc_dev, "%s tag %x offset %x val %x\n",



Home | Main Index | Thread Index | Old Index