lib: Allow pipe_crc_free(NULL)

Prevent pipe_crc_free() from segfaulting on NULL ptr.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
Ville Syrjälä 2013-10-21 19:37:33 +03:00
parent 471ec64de8
commit 987bcd9a5b

View File

@ -197,6 +197,9 @@ void igt_pipe_crc_reset(void)
void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc) void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
{ {
if (!pipe_crc)
return;
close(pipe_crc->ctl_fd); close(pipe_crc->ctl_fd);
close(pipe_crc->crc_fd); close(pipe_crc->crc_fd);
free(pipe_crc); free(pipe_crc);