Module Name:    src
Committed By:   jakllsch
Date:           Sun Feb 19 14:34:40 UTC 2017

Modified Files:
        src/sys/arch/shark/ofw: vlpci.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/shark/ofw/vlpci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/shark/ofw/vlpci.c
diff -u src/sys/arch/shark/ofw/vlpci.c:1.2 src/sys/arch/shark/ofw/vlpci.c:1.3
--- src/sys/arch/shark/ofw/vlpci.c:1.2	Sat Feb 18 13:56:29 2017
+++ src/sys/arch/shark/ofw/vlpci.c	Sun Feb 19 14:34:40 2017
@@ -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 @@ vlpci_pc_conf_read(void *v, pcitag_t tag
 	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 @@ vlpci_pc_conf_write(void *v, pcitag_t ta
 	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",

Reply via email to