]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(el3-spmc): error handling in allocation
authorvallau01 <valentin.laurent@trustonic.com>
Tue, 9 Aug 2022 16:03:28 +0000 (18:03 +0200)
committerLukas Hanel <lukas.hanel@trustonic.com>
Wed, 2 Nov 2022 14:15:59 +0000 (15:15 +0100)
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 <lukas.hanel@trustonic.com>
services/std_svc/spm/el3_spmc/spmc_shared_mem.c

index e137346e0b4740825db5835826c1ca5452fbf818..1da2efc149ed36c98f4ed111e780cc7204fc47dc 100644 (file)
@@ -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;
                }