All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/3] tests/kms_cursor_crc: Fix segfault on skip
Date: Wed, 15 Jul 2020 18:05:41 +0300	[thread overview]
Message-ID: <20200715150542.30405-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20200715150542.30405-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The fixture at the end of the test currently tries to free the
batch whether or not it even got allocated. This causes the test
to segfault on many skips. Check that we have the batch before
trying to free it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_cursor_crc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 7e6b24cc04a3..dc0880a77e87 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -827,10 +827,10 @@ igt_main
 			igt_pipe_crc_free(data.pipe_crc);
 		}
 
-		if (data.bufmgr != NULL) {
+		if (data.batch != NULL)
 			intel_batchbuffer_free(data.batch);
+		if (data.bufmgr != NULL)
 			drm_intel_bufmgr_destroy(data.bufmgr);
-		}
 
 		igt_display_fini(&data.display);
 	}
-- 
2.26.2

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

  reply	other threads:[~2020-07-15 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 15:05 [igt-dev] [PATCH i-g-t 1/3] tools/intel_watermark: Deal with TGL planes Ville Syrjala
2020-07-15 15:05 ` Ville Syrjala [this message]
2020-07-15 15:05 ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_color_helper: Respect --skip-crc-compare Ville Syrjala
2020-07-15 15:31 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/3] tools/intel_watermark: Deal with TGL planes Patchwork
2020-07-15 19:45 ` [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=20200715150542.30405-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.