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/igt_device.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/igt_device.c')
-rw-r--r-- | lib/igt_device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/igt_device.c b/lib/igt_device.c index 07bb0a0d..c50bf4a1 100644 --- a/lib/igt_device.c +++ b/lib/igt_device.c @@ -193,7 +193,7 @@ static struct pci_device *__igt_device_get_pci_device(int fd) return NULL; } - if (pci_system_init()) { + if (igt_pci_system_init()) { igt_warn("Couldn't initialize PCI system\n"); return NULL; } |