commit | 96d5449211228c141b65dbe60a121c23f6c79cfb | [log] [tgz] |
---|---|---|
author | Sumanth Bhat <sumanth.bhat@linux.intel.com> | Tue Jul 14 17:10:04 2020 +0530 |
committer | Sumanth Bhat <sumanth.bhat@linux.intel.com> | Tue Jul 14 17:10:04 2020 +0530 |
tree | dd7a76822417dcb2c38f83de0b71a6580d274f1f | |
parent | 2c820c5ad4557332c6409fbd53539efd50c6d28f [diff] |
core: handle memory allocation failures in mctp init This just handles __mctp_alloc failures in libmctp. Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com> Change-Id: I0b5beaf2b981a56133bd6caaf269e75e28cefba7
diff --git a/core.c b/core.c index 1b7ee39..0be8c69 100644 --- a/core.c +++ b/core.c
@@ -246,6 +246,10 @@ struct mctp *mctp; mctp = __mctp_alloc(sizeof(*mctp)); + + if(!mctp) + return NULL; + memset(mctp, 0, sizeof(*mctp)); mctp->max_message_size = MCTP_MAX_MESSAGE_SIZE;