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
This commit is contained in:
John Baldwin 2012-01-19 21:38:19 +00:00
parent d99ecc7db3
commit df4ce32fcb

View File

@ -1136,11 +1136,9 @@ pci_get_vpd_readonly_method(device_t dev, device_t child, const char *kw,
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);
}