Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jan 2012 21:38:19 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230340 - head/sys/dev/pci
Message-ID:  <201201192138.q0JLcJru008876@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Jan 19 21:38:19 2012
New Revision: 230340
URL: http://svn.freebsd.org/changeset/base/230340

Log:
  Properly return success once a matching VPD entry is found in
  pci_get_vpd_readonly_method().  Previously the loop was always running
  to completion and falling through to failing with ENXIO.
  
  PR:		kern/164313
  Submitted by:	Chuck Tuffli  chuck tuffli net
  MFC after:	1 week

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

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Thu Jan 19 20:31:29 2012	(r230339)
+++ head/sys/dev/pci/pci.c	Thu Jan 19 21:38:19 2012	(r230340)
@@ -1136,11 +1136,9 @@ pci_get_vpd_readonly_method(device_t dev
 		if (memcmp(kw, cfg->vpd.vpd_ros[i].keyword,
 		    sizeof(cfg->vpd.vpd_ros[i].keyword)) == 0) {
 			*vptr = cfg->vpd.vpd_ros[i].value;
+			return (0);
 		}
 
-	if (i != cfg->vpd.vpd_rocnt)
-		return (0);
-
 	*vptr = NULL;
 	return (ENXIO);
 }



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