diff options
author | Jim Quigley <jim.quigley@arm.com> | 2020-03-05 18:25:27 +0000 |
---|---|---|
committer | nicola-mazzucato-arm <42373140+nicola-mazzucato-arm@users.noreply.github.com> | 2020-03-12 17:23:30 +0000 |
commit | a366c5c6da1a93a9f374784fb9a6af0edb4027fd (patch) | |
tree | 270d41194774a04112a9be40863fabc1b9199a9f /module/system_power | |
parent | c24d8666b033d87e02d2cec5b3fb031d6aa63a8d (diff) |
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 <jim.quigley@arm.com>
Diffstat (limited to 'module/system_power')
-rw-r--r-- | module/system_power/src/mod_system_power.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/module/system_power/src/mod_system_power.c b/module/system_power/src/mod_system_power.c index 33fdc075..408a7563 100644 --- a/module/system_power/src/mod_system_power.c +++ b/module/system_power/src/mod_system_power.c @@ -381,15 +381,11 @@ static int system_power_mod_init(fwk_id_t module_id, system_power_ctx.dev_ctx_table = fwk_mm_calloc(element_count, sizeof(struct system_power_dev_ctx)); - if (system_power_ctx.dev_ctx_table == NULL) - return FWK_E_NOMEM; if (system_power_ctx.config->ext_ppus_count > 0) { system_power_ctx.ext_ppu_apis = fwk_mm_calloc( system_power_ctx.config->ext_ppus_count, sizeof(system_power_ctx.ext_ppu_apis[0])); - if (system_power_ctx.ext_ppu_apis == NULL) - return FWK_E_NOMEM; } if (system_power_ctx.config->soc_wakeup_irq != FWK_INTERRUPT_NONE) { |