summaryrefslogtreecommitdiff
path: root/lib/igt_core.c
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2019-01-16 13:20:46 +0200
committerPetri Latvala <petri.latvala@intel.com>2019-01-21 13:51:01 +0200
commitcc6474a9b36f30bd1d11bb169ecdca0a149cd135 (patch)
tree9ab29b4b7abb0a5b42b6dd7d47af60cfba462172 /lib/igt_core.c
parent733228fbcf5aa813d74f14ed4d488f11330d2827 (diff)
lib/igt_core: Handle all failures to read .igtrc
Parse error is not the only way to fail loading the file. A common other error is the file not existing. Handle all failures to read .igtrc by releasing the key store immediately. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r--lib/igt_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 26dd2789..0cae9b6a 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -591,7 +591,7 @@ static void common_init_config(void)
igt_key_file = g_key_file_new();
ret = g_key_file_load_from_file(igt_key_file, key_file_loc,
G_KEY_FILE_NONE, &error);
- if (error && error->code == G_KEY_FILE_ERROR) {
+ if (!ret) {
g_error_free(error);
g_key_file_free(igt_key_file);
igt_key_file = NULL;