From 0e6f373d203da16bd41b3199915e7fea97d944d6 Mon Sep 17 00:00:00 2001 From: Burt P Date: Sat, 28 Dec 2019 00:51:22 -0600 Subject: pci_util: lpereira's nits Signed-off-by: Burt P --- hardinfo/pci_util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hardinfo') 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", -- cgit v1.2.3