aboutsummaryrefslogtreecommitdiff
path: root/product/rddaniel
diff options
context:
space:
mode:
authorJim Quigley <jim.quigley@arm.com>2020-03-05 18:25:27 +0000
committernicola-mazzucato-arm <42373140+nicola-mazzucato-arm@users.noreply.github.com>2020-03-12 17:23:30 +0000
commita366c5c6da1a93a9f374784fb9a6af0edb4027fd (patch)
tree270d41194774a04112a9be40863fabc1b9199a9f /product/rddaniel
parentc24d8666b033d87e02d2cec5b3fb031d6aa63a8d (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 'product/rddaniel')
-rw-r--r--product/rddaniel/scp_ramfw/config_power_domain.c6
-rw-r--r--product/rddaniel/scp_ramfw/config_ppu_v1.c8
2 files changed, 0 insertions, 14 deletions
diff --git a/product/rddaniel/scp_ramfw/config_power_domain.c b/product/rddaniel/scp_ramfw/config_power_domain.c
index f99367c0..a35a58cb 100644
--- a/product/rddaniel/scp_ramfw/config_power_domain.c
+++ b/product/rddaniel/scp_ramfw/config_power_domain.c
@@ -311,13 +311,9 @@ static const struct fwk_element *rddaniel_power_domain_get_element_table
+ FWK_ARRAY_SIZE(rddaniel_power_domain_static_element_table)
+ 1, /* Terminator */
sizeof(struct fwk_element));
- if (element_table == NULL)
- return NULL;
pd_config_table = fwk_mm_calloc(core_count,
sizeof(struct mod_power_domain_element_config));
- if (pd_config_table == NULL)
- return NULL;
for (cluster_idx = 0; cluster_idx < cluster_count; cluster_idx++) {
for (core_idx = 0;
@@ -328,8 +324,6 @@ static const struct fwk_element *rddaniel_power_domain_get_element_table
pd_config = &pd_config_table[core_element_count];
element->name = fwk_mm_alloc(PD_NAME_SIZE, 1);
- if (element->name == NULL)
- return NULL;
snprintf((char *)element->name, PD_NAME_SIZE, "CLUS%uCORE%u",
cluster_idx, core_idx);
diff --git a/product/rddaniel/scp_ramfw/config_ppu_v1.c b/product/rddaniel/scp_ramfw/config_ppu_v1.c
index 43edf01e..d8f16387 100644
--- a/product/rddaniel/scp_ramfw/config_ppu_v1.c
+++ b/product/rddaniel/scp_ramfw/config_ppu_v1.c
@@ -75,13 +75,9 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
element_table = fwk_mm_calloc(core_count + cluster_count +
FWK_ARRAY_SIZE(ppu_v1_system_element_table) + 1,
sizeof(struct fwk_element));
- if (element_table == NULL)
- return NULL;
pd_config_table = fwk_mm_calloc(core_count + cluster_count,
sizeof(struct mod_ppu_v1_pd_config));
- if (pd_config_table == NULL)
- return NULL;
for (cluster_idx = 0; cluster_idx < cluster_count; cluster_idx++) {
for (core_idx = 0;
@@ -91,8 +87,6 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
pd_config = &pd_config_table[core_element_count];
element->name = fwk_mm_alloc(PPU_CORE_NAME_SIZE, 1);
- if (element->name == NULL)
- return NULL;
snprintf((char *)element->name, PPU_CORE_NAME_SIZE, "CLUS%uCORE%u",
cluster_idx, core_idx);
@@ -113,8 +107,6 @@ static const struct fwk_element *ppu_v1_get_element_table(fwk_id_t module_id)
pd_config = &pd_config_table[core_count + cluster_idx];
element->name = fwk_mm_alloc(PPU_CLUS_NAME_SIZE, 1);
- if (element->name == NULL)
- return NULL;
snprintf((char *)element->name, PPU_CLUS_NAME_SIZE, "CLUS%u",
cluster_idx);