aboutsummaryrefslogtreecommitdiff
path: root/module
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 /module
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 'module')
-rw-r--r--module/clock/src/mod_clock.c3
-rw-r--r--module/cmn600/src/mod_cmn600.c8
-rw-r--r--module/cmn_rhodes/src/mod_cmn_rhodes.c10
-rw-r--r--module/css_clock/src/mod_css_clock.c3
-rw-r--r--module/dvfs/src/mod_dvfs.c2
-rw-r--r--module/dw_apb_i2c/src/mod_dw_apb_i2c.c3
-rw-r--r--module/gtimer/src/mod_gtimer.c3
-rw-r--r--module/i2c/src/mod_i2c.c3
-rw-r--r--module/mhu/src/mod_mhu.c4
-rw-r--r--module/mhu2/src/mod_mhu2.c9
-rw-r--r--module/mock_psu/src/mod_mock_psu.c2
-rw-r--r--module/pik_clock/src/mod_pik_clock.c2
-rw-r--r--module/pl011/src/mod_pl011.c2
-rw-r--r--module/power_domain/src/mod_power_domain.c2
-rw-r--r--module/ppu_v0/src/mod_ppu_v0.c2
-rw-r--r--module/ppu_v1/src/mod_ppu_v1.c4
-rw-r--r--module/psu/src/mod_psu.c2
-rw-r--r--module/reg_sensor/src/mod_reg_sensor.c3
-rw-r--r--module/scmi/src/mod_scmi.c4
-rw-r--r--module/scmi_clock/src/mod_scmi_clock.c2
-rw-r--r--module/scmi_perf/src/mod_scmi_perf.c2
-rw-r--r--module/scmi_sensor/src/mod_scmi_sensor.c2
-rw-r--r--module/sensor/src/mod_sensor.c3
-rw-r--r--module/smt/src/mod_smt.c13
-rw-r--r--module/system_pll/src/mod_system_pll.c3
-rw-r--r--module/system_power/src/mod_system_power.c4
-rw-r--r--module/timer/src/mod_timer.c10
27 files changed, 1 insertions, 109 deletions
diff --git a/module/clock/src/mod_clock.c b/module/clock/src/mod_clock.c
index 52e26647..0824f985 100644
--- a/module/clock/src/mod_clock.c
+++ b/module/clock/src/mod_clock.c
@@ -320,9 +320,6 @@ static int clock_init(fwk_id_t module_id, unsigned int element_count,
module_ctx.config = config;
module_ctx.dev_ctx_table = fwk_mm_calloc(element_count,
sizeof(struct clock_dev_ctx));
- if (module_ctx.dev_ctx_table == NULL)
- return FWK_E_NOMEM;
-
return FWK_SUCCESS;
}
diff --git a/module/cmn600/src/mod_cmn600.c b/module/cmn600/src/mod_cmn600.c
index 2d4dfab4..04fdce66 100644
--- a/module/cmn600/src/mod_cmn600.c
+++ b/module/cmn600/src/mod_cmn600.c
@@ -556,16 +556,12 @@ static int cmn600_setup(void)
if (ctx->internal_rnsam_count != 0) {
ctx->internal_rnsam_table = fwk_mm_calloc(
ctx->internal_rnsam_count, sizeof(*ctx->internal_rnsam_table));
- if (ctx->internal_rnsam_table == NULL)
- return FWK_E_NOMEM;
}
/* Tuples for the external RN-RAM nodes (including their node IDs) */
if (ctx->external_rnsam_count != 0) {
ctx->external_rnsam_table = fwk_mm_calloc(
ctx->external_rnsam_count, sizeof(*ctx->external_rnsam_table));
- if (ctx->external_rnsam_table == NULL)
- return FWK_E_NOMEM;
}
/* Cache groups */
@@ -577,8 +573,6 @@ static int cmn600_setup(void)
ctx->hnf_cache_group = fwk_mm_calloc(
ctx->hnf_count / CMN600_HNF_CACHE_GROUP_ENTRIES_PER_GROUP,
sizeof(*ctx->hnf_cache_group));
- if (ctx->hnf_cache_group == NULL)
- return FWK_E_NOMEM;
}
}
@@ -717,8 +711,6 @@ static int cmn600_init(fwk_id_t module_id, unsigned int element_count,
/* Allocate space for the context */
ctx = fwk_mm_calloc(1, sizeof(*ctx));
- if (ctx == NULL)
- return FWK_E_NOMEM;
if (config->base == 0)
return FWK_E_DATA;
diff --git a/module/cmn_rhodes/src/mod_cmn_rhodes.c b/module/cmn_rhodes/src/mod_cmn_rhodes.c
index 0c63f0df..57b1d736 100644
--- a/module/cmn_rhodes/src/mod_cmn_rhodes.c
+++ b/module/cmn_rhodes/src/mod_cmn_rhodes.c
@@ -410,16 +410,12 @@ static int cmn_rhodes_setup(void)
if (ctx->internal_rnsam_count != 0) {
ctx->internal_rnsam_table = fwk_mm_calloc(
ctx->internal_rnsam_count, sizeof(*ctx->internal_rnsam_table));
- if (ctx->internal_rnsam_table == NULL)
- return FWK_E_NOMEM;
}
/* Tuples for the external RN-RAM nodes (including their node IDs) */
if (ctx->external_rnsam_count != 0) {
ctx->external_rnsam_table = fwk_mm_calloc(
ctx->external_rnsam_count, sizeof(*ctx->external_rnsam_table));
- if (ctx->external_rnsam_table == NULL)
- return FWK_E_NOMEM;
}
/* Cache groups */
@@ -431,14 +427,10 @@ static int cmn_rhodes_setup(void)
ctx->hnf_cache_group = fwk_mm_calloc(
ctx->hnf_count / CMN_RHODES_HNF_CACHE_GROUP_ENTRIES_PER_GROUP,
sizeof(*ctx->hnf_cache_group));
- if (ctx->hnf_cache_group == NULL)
- return FWK_E_NOMEM;
ctx->sn_nodeid_group = fwk_mm_calloc(
ctx->hnf_count /
CMN_RHODES_RNSAM_SYS_CACHE_GRP_SN_NODEID_ENTRIES_PER_GROUP,
sizeof(*ctx->sn_nodeid_group));
- if (ctx->sn_nodeid_group == NULL)
- return FWK_E_NOMEM;
}
}
@@ -499,8 +491,6 @@ static int cmn_rhodes_init(fwk_id_t module_id, unsigned int element_count,
/* Allocate space for the context */
ctx = fwk_mm_calloc(1, sizeof(*ctx));
- if (ctx == NULL)
- return FWK_E_NOMEM;
if (config->base == 0)
return FWK_E_DATA;
diff --git a/module/css_clock/src/mod_css_clock.c b/module/css_clock/src/mod_css_clock.c
index 06b5accf..39945dc4 100644
--- a/module/css_clock/src/mod_css_clock.c
+++ b/module/css_clock/src/mod_css_clock.c
@@ -338,9 +338,6 @@ static int css_clock_init(fwk_id_t module_id, unsigned int element_count,
module_ctx.dev_ctx_table = fwk_mm_calloc(element_count,
sizeof(struct css_clock_dev_ctx));
- if (module_ctx.dev_ctx_table == NULL)
- return FWK_E_NOMEM;
-
return FWK_SUCCESS;
}
diff --git a/module/dvfs/src/mod_dvfs.c b/module/dvfs/src/mod_dvfs.c
index 66cef79f..7912ee7f 100644
--- a/module/dvfs/src/mod_dvfs.c
+++ b/module/dvfs/src/mod_dvfs.c
@@ -994,8 +994,6 @@ static int dvfs_init(fwk_id_t module_id, unsigned int element_count,
{
dvfs_ctx.domain_ctx = fwk_mm_calloc(element_count,
sizeof((*dvfs_ctx.domain_ctx)[0]));
- if (dvfs_ctx.domain_ctx == NULL)
- return FWK_E_NOMEM;
dvfs_ctx.dvfs_domain_element_count = element_count;
diff --git a/module/dw_apb_i2c/src/mod_dw_apb_i2c.c b/module/dw_apb_i2c/src/mod_dw_apb_i2c.c
index 96aef224..f7345ade 100644
--- a/module/dw_apb_i2c/src/mod_dw_apb_i2c.c
+++ b/module/dw_apb_i2c/src/mod_dw_apb_i2c.c
@@ -224,9 +224,6 @@ static int dw_apb_i2c_init(fwk_id_t module_id,
{
ctx_table = fwk_mm_calloc(element_count, sizeof(*ctx_table));
- if (ctx_table == NULL)
- return FWK_E_NOMEM;
-
return FWK_SUCCESS;
}
diff --git a/module/gtimer/src/mod_gtimer.c b/module/gtimer/src/mod_gtimer.c
index d358c16d..d281c679 100644
--- a/module/gtimer/src/mod_gtimer.c
+++ b/module/gtimer/src/mod_gtimer.c
@@ -166,9 +166,6 @@ static int gtimer_init(fwk_id_t module_id,
{
ctx_table = fwk_mm_alloc(element_count, sizeof(struct dev_ctx));
- if (ctx_table == NULL)
- return FWK_E_NOMEM;
-
return FWK_SUCCESS;
}
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;
}
diff --git a/module/mhu/src/mod_mhu.c b/module/mhu/src/mod_mhu.c
index 337ec6bc..caf49f30 100644
--- a/module/mhu/src/mod_mhu.c
+++ b/module/mhu/src/mod_mhu.c
@@ -137,8 +137,6 @@ static int mhu_init(fwk_id_t module_id, unsigned int device_count,
mhu_ctx.device_ctx_table = fwk_mm_calloc(device_count,
sizeof(mhu_ctx.device_ctx_table[0]));
- if (mhu_ctx.device_ctx_table == NULL)
- return FWK_E_NOMEM;
mhu_ctx.device_count = device_count;
@@ -158,8 +156,6 @@ static int mhu_device_init(fwk_id_t device_id, unsigned int slot_count,
device_ctx->smt_channel_table = fwk_mm_calloc(slot_count,
sizeof(device_ctx->smt_channel_table[0]));
- if (device_ctx->smt_channel_table == NULL)
- return FWK_E_NOMEM;
device_ctx->config = config;
device_ctx->slot_count = slot_count;
diff --git a/module/mhu2/src/mod_mhu2.c b/module/mhu2/src/mod_mhu2.c
index 8e2f9eae..67a6c7eb 100644
--- a/module/mhu2/src/mod_mhu2.c
+++ b/module/mhu2/src/mod_mhu2.c
@@ -131,11 +131,6 @@ static int mhu2_init(fwk_id_t module_id,
ctx.channel_ctx_table = fwk_mm_calloc(channel_count,
sizeof(ctx.channel_ctx_table[0]));
- if (ctx.channel_ctx_table == NULL) {
- /* Unable to allocate memory for channel context table */
- assert(false);
- return FWK_E_NOMEM;
- }
ctx.channel_count = channel_count;
@@ -171,10 +166,6 @@ static int mhu2_channel_init(fwk_id_t channel_id,
channel_ctx->smt_channel_table =
fwk_mm_calloc(slot_count, sizeof(channel_ctx->smt_channel_table[0]));
- if (channel_ctx->smt_channel_table == NULL) {
- assert(false);
- return FWK_E_NOMEM;
- }
return FWK_SUCCESS;
}
diff --git a/module/mock_psu/src/mod_mock_psu.c b/module/mock_psu/src/mod_mock_psu.c
index 333f05bb..7d9294c1 100644
--- a/module/mock_psu/src/mod_mock_psu.c
+++ b/module/mock_psu/src/mod_mock_psu.c
@@ -306,8 +306,6 @@ static int mod_mock_psu_init(
mod_mock_psu_ctx.elements =
fwk_mm_calloc(element_count, sizeof(mod_mock_psu_ctx.elements[0]));
- if (mod_mock_psu_ctx.elements == NULL)
- return FWK_E_NOMEM;
return FWK_SUCCESS;
}
diff --git a/module/pik_clock/src/mod_pik_clock.c b/module/pik_clock/src/mod_pik_clock.c
index 7fea9f88..0211e87e 100644
--- a/module/pik_clock/src/mod_pik_clock.c
+++ b/module/pik_clock/src/mod_pik_clock.c
@@ -627,8 +627,6 @@ static int pik_clock_init(fwk_id_t module_id, unsigned int element_count,
module_ctx.dev_ctx_table = fwk_mm_calloc(element_count,
sizeof(struct pik_clock_dev_ctx));
- if (module_ctx.dev_ctx_table == NULL)
- return FWK_E_NOMEM;
return FWK_SUCCESS;
}
diff --git a/module/pl011/src/mod_pl011.c b/module/pl011/src/mod_pl011.c
index 3986ef44..b03a92ce 100644
--- a/module/pl011/src/mod_pl011.c
+++ b/module/pl011/src/mod_pl011.c
@@ -155,8 +155,6 @@ static int pl011_init(fwk_id_t module_id, unsigned int element_count,
return FWK_E_DATA;
dev_ctx_table = fwk_mm_calloc(element_count, sizeof(dev_ctx_table[0]));
- if (dev_ctx_table == NULL)
- return FWK_E_NOMEM;
return FWK_SUCCESS;
}
diff --git a/module/power_domain/src/mod_power_domain.c b/module/power_domain/src/mod_power_domain.c
index c219e96f..3d2b3e62 100644
--- a/module/power_domain/src/mod_power_domain.c
+++ b/module/power_domain/src/mod_power_domain.c
@@ -1745,8 +1745,6 @@ static int pd_init(fwk_id_t module_id, unsigned int dev_count,
return FWK_E_PARAM;
mod_pd_ctx.pd_ctx_table = fwk_mm_calloc(dev_count, sizeof(struct pd_ctx));
- if (mod_pd_ctx.pd_ctx_table == NULL)
- return FWK_E_NOMEM;
mod_pd_ctx.pd_count = dev_count;
mod_pd_ctx.system_pd_ctx = &mod_pd_ctx.pd_ctx_table[dev_count - 1];
diff --git a/module/ppu_v0/src/mod_ppu_v0.c b/module/ppu_v0/src/mod_ppu_v0.c
index 4a7517f4..a3d4263b 100644
--- a/module/ppu_v0/src/mod_ppu_v0.c
+++ b/module/ppu_v0/src/mod_ppu_v0.c
@@ -170,8 +170,6 @@ static int ppu_v0_mod_init(fwk_id_t module_id, unsigned int pd_count,
{
ppu_v0_ctx.pd_ctx_table = fwk_mm_calloc(pd_count,
sizeof(struct ppu_v0_pd_ctx));
- if (ppu_v0_ctx.pd_ctx_table == NULL)
- return FWK_E_NOMEM;
return FWK_SUCCESS;
}
diff --git a/module/ppu_v1/src/mod_ppu_v1.c b/module/ppu_v1/src/mod_ppu_v1.c
index 1536fbfb..fb39ff71 100644
--- a/module/ppu_v1/src/mod_ppu_v1.c
+++ b/module/ppu_v1/src/mod_ppu_v1.c
@@ -648,8 +648,6 @@ static int ppu_v1_mod_init(fwk_id_t module_id, unsigned int pd_count,
{
ppu_v1_ctx.pd_ctx_table = fwk_mm_calloc(pd_count,
sizeof(struct ppu_v1_pd_ctx));
- if (ppu_v1_ctx.pd_ctx_table == NULL)
- return FWK_E_NOMEM;
ppu_v1_ctx.pd_ctx_table_size = pd_count;
@@ -677,8 +675,6 @@ static int ppu_v1_pd_init(fwk_id_t pd_id, unsigned int unused, const void *data)
if (config->pd_type == MOD_PD_TYPE_CLUSTER) {
pd_ctx->data = fwk_mm_calloc(1, sizeof(struct ppu_v1_cluster_pd_ctx));
- if (pd_ctx->data == NULL)
- return FWK_E_NOMEM;
}
if (config->default_power_on) {
diff --git a/module/psu/src/mod_psu.c b/module/psu/src/mod_psu.c
index 4426193c..6f8d4538 100644
--- a/module/psu/src/mod_psu.c
+++ b/module/psu/src/mod_psu.c
@@ -275,8 +275,6 @@ static int mod_psu_init(
mod_psu_ctx.elements =
fwk_mm_calloc(element_count, sizeof(mod_psu_ctx.elements[0]));
- if (mod_psu_ctx.elements == NULL)
- return FWK_E_NOMEM;
return FWK_SUCCESS;
}
diff --git a/module/reg_sensor/src/mod_reg_sensor.c b/module/reg_sensor/src/mod_reg_sensor.c
index be3ef06b..3f95be41 100644
--- a/module/reg_sensor/src/mod_reg_sensor.c
+++ b/module/reg_sensor/src/mod_reg_sensor.c
@@ -64,9 +64,6 @@ static int reg_sensor_init(fwk_id_t module_id,
{
config_table = fwk_mm_alloc(element_count, sizeof(*config_table));
- if (config_table == NULL)
- return FWK_E_NOMEM;
-
return FWK_SUCCESS;
}
diff --git a/module/scmi/src/mod_scmi.c b/module/scmi/src/mod_scmi.c
index 21e09808..0639e28b 100644
--- a/module/scmi/src/mod_scmi.c
+++ b/module/scmi/src/mod_scmi.c
@@ -567,13 +567,9 @@ static int scmi_init(fwk_id_t module_id, unsigned int service_count,
scmi_ctx.protocol_table = fwk_mm_calloc(
config->protocol_count_max + PROTOCOL_TABLE_RESERVED_ENTRIES_COUNT,
sizeof(scmi_ctx.protocol_table[0]));
- if (scmi_ctx.protocol_table == NULL)
- return FWK_E_NOMEM;
scmi_ctx.service_ctx_table = fwk_mm_calloc(
service_count, sizeof(scmi_ctx.service_ctx_table[0]));
- if (scmi_ctx.service_ctx_table == NULL)
- return FWK_E_NOMEM;
scmi_ctx.protocol_table[PROTOCOL_TABLE_BASE_PROTOCOL_IDX].message_handler =
scmi_base_message_handler;
diff --git a/module/scmi_clock/src/mod_scmi_clock.c b/module/scmi_clock/src/mod_scmi_clock.c
index 0ce6bb61..a611dcc2 100644
--- a/module/scmi_clock/src/mod_scmi_clock.c
+++ b/module/scmi_clock/src/mod_scmi_clock.c
@@ -983,8 +983,6 @@ static int scmi_clock_init(fwk_id_t module_id, unsigned int element_count,
scmi_clock_ctx.clock_ops =
fwk_mm_calloc((unsigned int)clock_devices,
sizeof(struct clock_operations));
- if (scmi_clock_ctx.clock_ops == NULL)
- return FWK_E_NOMEM;
/* Initialize table */
for (unsigned int i = 0; i < (unsigned int)clock_devices; i++)
diff --git a/module/scmi_perf/src/mod_scmi_perf.c b/module/scmi_perf/src/mod_scmi_perf.c
index 4b212ddb..b52ef71e 100644
--- a/module/scmi_perf/src/mod_scmi_perf.c
+++ b/module/scmi_perf/src/mod_scmi_perf.c
@@ -687,8 +687,6 @@ static int scmi_perf_init(fwk_id_t module_id, unsigned int element_count,
scmi_perf_ctx.perf_ops_table = fwk_mm_calloc(return_val,
sizeof(struct perf_operations));
- if (scmi_perf_ctx.perf_ops_table == NULL)
- return FWK_E_NOMEM;
scmi_perf_ctx.config = config;
scmi_perf_ctx.domain_count = return_val;
diff --git a/module/scmi_sensor/src/mod_scmi_sensor.c b/module/scmi_sensor/src/mod_scmi_sensor.c
index 7268cbc3..b5559b83 100644
--- a/module/scmi_sensor/src/mod_scmi_sensor.c
+++ b/module/scmi_sensor/src/mod_scmi_sensor.c
@@ -468,8 +468,6 @@ static int scmi_sensor_init(fwk_id_t module_id,
scmi_sensor_ctx.sensor_ops_table =
fwk_mm_calloc(scmi_sensor_ctx.sensor_count,
sizeof(struct sensor_operations));
- if (scmi_sensor_ctx.sensor_ops_table == NULL)
- return FWK_E_NOMEM;
/* Initialize the service identifier for each sensor to 'available' */
for (unsigned int i = 0; i < scmi_sensor_ctx.sensor_count; i++)
diff --git a/module/sensor/src/mod_sensor.c b/module/sensor/src/mod_sensor.c
index 5343619b..e11dae56 100644
--- a/module/sensor/src/mod_sensor.c
+++ b/module/sensor/src/mod_sensor.c
@@ -141,9 +141,6 @@ static int sensor_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;
}
diff --git a/module/smt/src/mod_smt.c b/module/smt/src/mod_smt.c
index 9a3c1e5a..c2515b20 100644
--- a/module/smt/src/mod_smt.c
+++ b/module/smt/src/mod_smt.c
@@ -334,10 +334,6 @@ static int smt_init(fwk_id_t module_id, unsigned int element_count,
{
smt_ctx.channel_ctx_table = fwk_mm_calloc(element_count,
sizeof(smt_ctx.channel_ctx_table[0]));
- if (smt_ctx.channel_ctx_table == NULL) {
- assert(false);
- return FWK_E_NOMEM;
- }
smt_ctx.channel_count = element_count;
return FWK_SUCCESS;
@@ -364,18 +360,9 @@ static int smt_channel_init(fwk_id_t channel_id, unsigned int unused,
channel_ctx->in = fwk_mm_alloc(1, channel_ctx->config->mailbox_size);
channel_ctx->out = fwk_mm_alloc(1, channel_ctx->config->mailbox_size);
- if ((channel_ctx->in == NULL) || (channel_ctx->out == NULL))
- return FWK_E_NOMEM;
-
channel_ctx->max_payload_size = channel_ctx->config->mailbox_size -
sizeof(struct mod_smt_memory);
- /* Check memory allocations */
- if ((channel_ctx->in == NULL) || (channel_ctx->out == NULL)) {
- assert(false);
- return FWK_E_NOMEM;
- }
-
return FWK_SUCCESS;
}
diff --git a/module/system_pll/src/mod_system_pll.c b/module/system_pll/src/mod_system_pll.c
index 6b8ba418..2e5e4b50 100644
--- a/module/system_pll/src/mod_system_pll.c
+++ b/module/system_pll/src/mod_system_pll.c
@@ -278,9 +278,6 @@ static int system_pll_init(fwk_id_t module_id, unsigned int element_count,
module_ctx.dev_ctx_table = fwk_mm_calloc(element_count,
sizeof(struct system_pll_dev_ctx));
- if (module_ctx.dev_ctx_table == NULL)
- return FWK_E_NOMEM;
-
return FWK_SUCCESS;
}
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) {
diff --git a/module/timer/src/mod_timer.c b/module/timer/src/mod_timer.c
index fbc90803..efebb8b6 100644
--- a/module/timer/src/mod_timer.c
+++ b/module/timer/src/mod_timer.c
@@ -531,9 +531,6 @@ static int timer_init(fwk_id_t module_id,
{
ctx_table = fwk_mm_calloc(element_count, sizeof(struct dev_ctx));
- if (ctx_table == NULL)
- return FWK_E_NOMEM;
-
return FWK_SUCCESS;
}
@@ -547,13 +544,8 @@ static int timer_device_init(fwk_id_t element_id, unsigned int alarm_count,
ctx = ctx_table + fwk_id_get_element_idx(element_id);
ctx->config = data;
- if (alarm_count > 0) {
+ if (alarm_count > 0)
ctx->alarm_pool = fwk_mm_calloc(alarm_count, sizeof(struct alarm_ctx));
- if (ctx->alarm_pool == NULL) {
- assert(false);
- return FWK_E_NOMEM;
- }
- }
return FWK_SUCCESS;
}