Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2012 19:51:59 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r231610 - stable/9/sys/dev/pci
Message-ID:  <201202131951.q1DJpxZo059316@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Mon Feb 13 19:51:59 2012
New Revision: 231610
URL: http://svn.freebsd.org/changeset/base/231610

Log:
  MFC 230340:
  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.

Modified:
  stable/9/sys/dev/pci/pci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/pci/pci.c
==============================================================================
--- stable/9/sys/dev/pci/pci.c	Mon Feb 13 19:49:45 2012	(r231609)
+++ stable/9/sys/dev/pci/pci.c	Mon Feb 13 19:51:59 2012	(r231610)
@@ -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?201202131951.q1DJpxZo059316>