From a366c5c6da1a93a9f374784fb9a6af0edb4027fd Mon Sep 17 00:00:00 2001 From: Jim Quigley Date: Thu, 5 Mar 2020 18:25:27 +0000 Subject: fwk/fwk_mm_alloc: panic if memory allocation failed Currently the framework will return NULL if the memory allocation fails. As the system will ultimately fail on receiving the error we could just panic instead, saving the memory used for the NULL checks. Change-Id: I731b87b7acb19d30df84936b07c76cbfe0d0726e Signed-off-by: Jim Quigley --- module/i2c/src/mod_i2c.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'module/i2c') diff --git a/module/i2c/src/mod_i2c.c b/module/i2c/src/mod_i2c.c index b4b7d9bb..2155debe 100644 --- a/module/i2c/src/mod_i2c.c +++ b/module/i2c/src/mod_i2c.c @@ -206,9 +206,6 @@ static int mod_i2c_init(fwk_id_t module_id, { ctx_table = fwk_mm_calloc(element_count, sizeof(ctx_table[0])); - if (ctx_table == NULL) - return FWK_E_NOMEM; - return FWK_SUCCESS; } -- cgit v1.2.3