public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Petri Latvala <petri.latvala@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc
Date: Wed, 16 Jan 2019 15:18:32 +0100	[thread overview]
Message-ID: <0be4b8406e7681733f499ab71bde8fc8c8b7d28f.camel@bootlin.com> (raw)
In-Reply-To: <20190116112050.27647-18-petri.latvala@intel.com>

On Wed, 2019-01-16 at 13:20 +0200, Petri Latvala wrote:
> 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>

> ---
>  lib/igt_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;
-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-01-16 14:18 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 11:20 [igt-dev] [PATCH i-g-t 00/21] Static analysis: misc cleanups and fixes Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 01/21] lib: Introduce igt_assume() Petri Latvala
2019-01-16 14:26   ` Chris Wilson
2019-01-18 10:34   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-21 11:33     ` [igt-dev] [PATCH i-g-t v3 01/21] lib: Introduce BUILD_BUG_ON_INVALID and igt_assume() Petri Latvala
2019-01-21 11:41       ` Chris Wilson
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 02/21] lib/i915/gem_context: Help static analysis with execution flow Petri Latvala
2019-01-16 11:30   ` Chris Wilson
2019-01-16 14:22   ` Chris Wilson
2019-01-18 10:42   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 03/21] lib/ioctl_wrappers: " Petri Latvala
2019-01-18 10:42   ` [igt-dev] [PATCH i-g-t v2 " Petri Latvala
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 04/21] lib/igt_kms: Use correct type for calloc Petri Latvala
2019-01-17  9:55   ` Abdiel Janulgue
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 05/21] tests: " Petri Latvala
2019-01-16 11:28   ` Kahola, Mika
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 06/21] lib: Avoid memcpying 0 bytes from NULL Petri Latvala
2019-01-17 11:14   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 07/21] overlay: Write out the assumption for kernel-provided data Petri Latvala
2019-01-28 13:21   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 08/21] benchmarks/wsim: Handle a parse error Petri Latvala
2019-01-16 11:45   ` Tvrtko Ursulin
2019-01-16 12:03     ` Petri Latvala
2019-01-16 12:07       ` Chris Wilson
2019-01-16 12:08       ` Tvrtko Ursulin
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 09/21] lib/igt_kms: Make igt_display_init require at least one plane Petri Latvala
2019-01-16 17:11   ` Robert Foss
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 10/21] tests/kms_color: Assert gamma look up table sizes Petri Latvala
2019-01-28 13:04   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 11/21] lib/igt_kms: Assert that active crtcs have at least one plane Petri Latvala
2019-01-16 11:30   ` Kahola, Mika
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 12/21] benchmarks/gem_userptr_benchmark: Correctly free memory Petri Latvala
2019-01-16 11:48   ` Tvrtko Ursulin
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 13/21] lib/igt_alsa: Remove dead assignment Petri Latvala
2019-01-16 14:14   ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 14/21] lib/igt_audio: Initialize freq in audio_signal_detect() Petri Latvala
2019-01-16 14:16   ` Paul Kocialkowski
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 15/21] igt_aux: Handle empty pm_test file gracefully Petri Latvala
2019-01-28 13:18   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 16/21] lib/igt_core: Assert that optarg is present Petri Latvala
2019-01-17 12:17   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 17/21] lib/igt_core: Handle all failures to read .igtrc Petri Latvala
2019-01-16 14:18   ` Paul Kocialkowski [this message]
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 18/21] lib/igt_core: Initialize fds in igt_system_quiet Petri Latvala
2019-01-17  9:56   ` Abdiel Janulgue
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 19/21] lib/igt_kms: Aid static analyzer with the control flow Petri Latvala
2019-01-28 13:17   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 20/21] lib/igt_x86: Mock-use variable to silence static analysis Petri Latvala
2019-01-28 13:11   ` Arkadiusz Hiler
2019-01-16 11:20 ` [igt-dev] [PATCH i-g-t 21/21] lib/drmtest: Don't read from NULL in set_forced_driver Petri Latvala
2019-01-16 12:15   ` Rodrigo Siqueira
2019-01-16 12:12 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes Patchwork
2019-01-16 22:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-18 11:22 ` [igt-dev] ✗ Fi.CI.BAT: failure for Static analysis: misc cleanups and fixes (rev4) Patchwork
2019-01-18 12:44 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2019-01-18 17:48 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-01-21 12:09 ` [igt-dev] ✓ Fi.CI.BAT: success for Static analysis: misc cleanups and fixes (rev5) Patchwork
2019-01-21 16:21 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0be4b8406e7681733f499ab71bde8fc8c8b7d28f.camel@bootlin.com \
    --to=paul.kocialkowski@bootlin.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox