diff options
author | Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> | 2022-02-22 10:41:20 +0100 |
---|---|---|
committer | Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> | 2022-02-22 15:50:50 +0100 |
commit | 5f3cfa485eb46902e55c6b96c80dc8c57ddf3b43 (patch) | |
tree | e8b9d7488332ff8ca589c6b33b59ecb9c4ec1eba /lib/intel_chipset.c | |
parent | 0696e8b9cd5f0e112f4d5459e03a1d4d6bb95d9a (diff) |
lib: Use safe wrappers around libpciaccess initialization functions
Multiple calls to igt functions using pci_system_init() provided by
libpciaccess result in memory leaking if not followed by its counterpart
pci_system_cleanup() before next use. On the other hand, calling
pci_system_cleanup() can affect other users which still depend on global
data initialized by pci_system_init().
Introduce safe IGT wrappers around those libpciaccess functions and use
those wrappers in IGT library and tests.
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
[jkrzyszt: shorten excessive long name of hidden variable (Chris)]
Reviewed-by: Chris Wilson <chris.p.wilson@intel.com>
Diffstat (limited to 'lib/intel_chipset.c')
-rw-r--r-- | lib/intel_chipset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/intel_chipset.c b/lib/intel_chipset.c index 4748a3fb..efb6f177 100644 --- a/lib/intel_chipset.c +++ b/lib/intel_chipset.c @@ -75,7 +75,7 @@ intel_get_pci_device(void) struct pci_device *pci_dev; int error; - error = pci_system_init(); + error = igt_pci_system_init(); igt_fail_on_f(error != 0, "Couldn't initialize PCI system\n"); |