Actions
Bug #5754
closedprtconf: assertion failure in libpcidb if vendor cannot be looked up
Start date:
2015-03-27
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
Description
# prtconf -dD System Configuration: Project OpenIndiana i86pc Memory size: 4096 Megabytes System Peripherals (Software Nodes): i86pc (driver name: rootnex) scsi_vhci, instance #0 (driver name: scsi_vhci) pci, instance #0 (driver name: pci) pci1af4,1100 (pci8086,1237) [Intel Corporation 440FX - 82441FX PMC [Natoma]] instance #0 (driver name: pci-ide) ide, instance #0 (driver name: ata) cmdk, instance #0 (driver name: cmdk) ide, instance #1 (driver name: ata) sd, instance #0 (driver name: sd) pci1af4,1100 (pci8086,7113) [Intel Corporation 82371AB/EB/MB PIIX4 ACPI] Assertion failed: v != NULL, file ../common/pcidb.c, line 426 display (pci1234,1111Abort
There are also two variables that can be checked without initialisation.
Trivial patch:
diff --git a/usr/src/cmd/prtconf/prt_xxx.c b/usr/src/cmd/prtconf/prt_xxx.c index 307e26fe4e0d5629c72c0c0adf9fe1910e062a58..e690c220e03fd68ca911f70f1ae8c530 --- a/usr/src/cmd/prtconf/prt_xxx.c +++ b/usr/src/cmd/prtconf/prt_xxx.c @@ -422,8 +422,8 @@ dump_priv_data(int ilev, di_node_t node) int print_pciid(di_node_t node, di_prom_handle_t ph, pcidb_hdl_t *pci) { - pcidb_vendor_t *vend; - pcidb_device_t *dev; + pcidb_vendor_t *vend = NULL; + pcidb_device_t *dev = NULL; di_node_t pnode = di_parent_node(node); char *s = NULL; int *i, type = di_nodeid(node); @@ -447,7 +447,7 @@ print_pciid(di_node_t node, di_prom_handle_t ph, pcidb_hdl_t "device-id", &i) > 0) (void) printf(",%x", i[0]); - if (pci != NULL) + if (vend != NULL) dev = pcidb_lookup_device_by_vendor(vend, i[0]); (void) printf(") [");
Updated by Electric Monk over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 48386468de9db5ac3a3f4109fbf99e624d0a46f8
commit 48386468de9db5ac3a3f4109fbf99e624d0a46f8 Author: Andy Fiddaman <omnios@citrus-it.net> Date: 2015-03-28T20:16:25.000Z 5754 prtconf: assertion failure in libpcidb if vendor cannot be looked up Reviewed by: Marcel Telka <marcel@telka.sk> Reviewed by: Richard PALO <richard@netbsd.org> Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Dan McDonald <danmcd@omniti.com>
Actions