]> git.ipfire.org Git - thirdparty/pciutils.git/commit
libpci: Always call pci_set_name_list_path() in pci_init_name_list_path()
authorPali Rohár <pali@kernel.org>
Sun, 27 Feb 2022 00:57:38 +0000 (01:57 +0100)
committerMartin Mareš <mj@ucw.cz>
Fri, 15 Apr 2022 21:57:52 +0000 (23:57 +0200)
commit5f93596f916038bdb611ca5af351e849f9c02d39
treea3863ed262eab3337f99f754a36c6fcd62f6a02b
parentdc687532cd7c93dbeeb44ad857ac9aa936d74064
libpci: Always call pci_set_name_list_path() in pci_init_name_list_path()

If pci_init_name_list_path() does not call pci_set_name_list_path() then
a->id_file_name variable is NULL and pci_load_name_list() would crash as it
tries to do fopen(NULL, ...).

If libpci was configured at compile time to use current executable path for
locating pci.ids file and it is not possible to determinate current
executable path then call pci_set_name_list_path() with just filename
without path (this would fallback to the current working directory).
lib/init.c