From: vallau01 Date: Tue, 9 Aug 2022 16:03:28 +0000 (+0200) Subject: fix(el3-spmc): error handling in allocation X-Git-Tag: baikal/aarch64/sdk5.9~49^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=cee8bb3b38ea266a5008719548965352ec695cae;p=arm-tf.git fix(el3-spmc): error handling in allocation Error check must be done on the previously allocated pointer, not a random one from the code. Change-Id: I1c8253eacbe778cc4a9a8d71081fc615fa7e5293 Signed-off-by: Lukas Hanel --- diff --git a/services/std_svc/spm/el3_spmc/spmc_shared_mem.c b/services/std_svc/spm/el3_spmc/spmc_shared_mem.c index e137346e0..1da2efc14 100644 --- a/services/std_svc/spm/el3_spmc/spmc_shared_mem.c +++ b/services/std_svc/spm/el3_spmc/spmc_shared_mem.c @@ -1030,7 +1030,7 @@ static long spmc_ffa_fill_desc(struct mailbox *mbox, v1_1_obj = spmc_shmem_obj_alloc(&spmc_shmem_obj_state, v1_1_desc_size); - if (!obj) { + if (!v1_1_obj) { ret = FFA_ERROR_NO_MEMORY; goto err_arg; }