Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5BA16EABD for ; Wed, 22 Sep 2021 07:42:46 +0000 (UTC) From: Bhanuprakash Modem Date: Wed, 22 Sep 2021 13:13:08 +0530 Message-Id: <20210922074308.35769-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t] lib/igt_debugfs: Handle memory allocation failures for CRC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: igt-dev@lists.freedesktop.org Cc: Bhanuprakash Modem List-ID: Throw assert if failed to allocate memory for pipe crc. Signed-off-by: Bhanuprakash Modem --- 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