[igt-dev] [PATCH i-g-t] lib/igt_debugfs: Handle memory allocation failures for CRC
Karthik B S
karthik.b.s at intel.com
Mon Sep 27 11:39:17 UTC 2021
On 9/22/2021 1:13 PM, Bhanuprakash Modem wrote:
> Throw assert if failed to allocate memory for pipe crc.
>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
Reviewed-by: Karthik B S <karthik.b.s 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);
More information about the igt-dev
mailing list