[igt-dev] [PATCH i-g-t] lib/igt_debugfs: Handle memory allocation failures for CRC

Bhanuprakash Modem bhanuprakash.modem at intel.com
Wed Sep 22 07:43:08 UTC 2021


Throw assert if failed to allocate memory for pipe crc.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 lib/igt_debugfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 2f58519a2..a5bb95ca3 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -688,6 +688,7 @@ pipe_crc_new(int fd, enum pipe pipe, const char *source, int flags)
 	igt_assert(debugfs != -1);
 
 	pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
+	igt_assert(pipe_crc);
 
 	sprintf(buf, "crtc-%d/crc/control", pipe);
 	pipe_crc->ctl_fd = openat(debugfs, buf, O_WRONLY);
-- 
2.32.0



More information about the igt-dev mailing list