kern/164313: Fix pci_get_vpd_readonly_method

John Baldwin jhb at FreeBSD.org
Thu Jan 19 19:50:12 UTC 2012


The following reply was made to PR kern/164313; it has been noted by GNATS.

From: John Baldwin <jhb at FreeBSD.org>
To: bug-followup at FreeBSD.org, chuck at tuffli.net
Cc:  
Subject: Re: kern/164313: Fix pci_get_vpd_readonly_method
Date: Thu, 19 Jan 2012 14:41:45 -0500

 Huh.  Might be even simpler to just return instead of breaking out of 
 the loop once vptr is found.
 
 Index: pci.c
 ===================================================================
 --- pci.c	(revision 230331)
 +++ pci.c	(working copy)
 @@ -1136,11 +1136,9 @@ pci_get_vpd_readonly_method(device_t dev, device_t
   		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);
   }
 
 Does this work for you as well?
 
 -- 
 John Baldwin


More information about the freebsd-bugs mailing list