diff options
author | Burt P <pburt0@gmail.com> | 2019-12-28 00:51:22 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-12-28 08:32:12 -0800 |
commit | 0e6f373d203da16bd41b3199915e7fea97d944d6 (patch) | |
tree | 40dac946ad091ede36a471115f46e9858d6ea425 /hardinfo/pci_util.c | |
parent | bf72686772b249a683570d9a0b47e139f5327a3c (diff) |
pci_util: lpereira's nits
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo/pci_util.c')
-rw-r--r-- | hardinfo/pci_util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hardinfo/pci_util.c b/hardinfo/pci_util.c index e7ae81ac..71fa1fe9 100644 --- a/hardinfo/pci_util.c +++ b/hardinfo/pci_util.c @@ -24,7 +24,7 @@ gchar *pci_ids_file = NULL; -void find_pci_ids_file() { +static void find_pci_ids_file() { if (pci_ids_file) return; char *file_search_order[] = { g_strdup("/usr/share/hwdata/pci.ids"), @@ -49,6 +49,8 @@ char *pci_lookup_ids_vendor_str(uint32_t id) { if (!pci_ids_file) find_pci_ids_file(); + if (!pci_ids_file) + return NULL; qpath = g_strdup_printf("%04x", id); scan_ids_file(pci_ids_file, qpath, &result, -1); @@ -66,6 +68,7 @@ static void pci_lookup_ids(pcid *d) { if (!pci_ids_file) find_pci_ids_file(); + if (!pci_ids_file) return; /* lookup vendor, device, sub device */ qpath = g_strdup_printf("%04x/%04x/%04x %04x", |