From 987bcd9a5b51db312588163d7f9a21654eb799e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Mon, 21 Oct 2013 19:37:33 +0300 Subject: [PATCH] lib: Allow pipe_crc_free(NULL) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevent pipe_crc_free() from segfaulting on NULL ptr. Signed-off-by: Ville Syrjälä --- lib/igt_debugfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index ca34c1e9..73d79230 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -197,6 +197,9 @@ void igt_pipe_crc_reset(void) void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc) { + if (!pipe_crc) + return; + close(pipe_crc->ctl_fd); close(pipe_crc->crc_fd); free(pipe_crc);