Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Sep 2009 18:48:49 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r197099 - head/sys/dev/pci
Message-ID:  <200909111848.n8BImnRM060314@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Fri Sep 11 18:48:49 2009
New Revision: 197099
URL: http://svn.freebsd.org/changeset/base/197099

Log:
  pci(4): don't perform maximum register number check
  
  Different sub-kinds of PCI buses may have different rules and
  thus it is up for the bus backends to do proper input checks.
  For example, PCIe allows configuration register numbers < 0x1000,
  while for PCI proper the limit is 0x100.
  And, in fact, the buses already do the checks.
  
  Reviewed by:	jhb
  MFC after:	1 week
  X-ToDo:		add check for negative value to bus backends
  X-ToDo:		use named constant for maximum PCIe register

Modified:
  head/sys/dev/pci/pci_user.c

Modified: head/sys/dev/pci/pci_user.c
==============================================================================
--- head/sys/dev/pci/pci_user.c	Fri Sep 11 17:25:24 2009	(r197098)
+++ head/sys/dev/pci/pci_user.c	Fri Sep 11 18:48:49 2009	(r197099)
@@ -605,9 +605,8 @@ getconfexit:
 		case 4:
 		case 2:
 		case 1:
-			/* Make sure register is in bounds and aligned. */
+			/* Make sure register is not negative and aligned. */
 			if (io->pi_reg < 0 ||
-			    io->pi_reg + io->pi_width > PCI_REGMAX + 1 ||
 			    io->pi_reg & (io->pi_width - 1)) {
 				error = EINVAL;
 				break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909111848.n8BImnRM060314>