svm: check svm_msg_q_size_to_alloc success

svm_msg_q_size_to_alloc must return a valid base address, if it fails
pass up the error for handling

Type: fix

Change-Id: I408492f65f646862122acb9a187819b3bbf4f91c
Signed-off-by: Ofer Heifetz <oferh@marvell.com>
This commit is contained in:
Ofer Heifetz
2022-06-29 20:18:27 +03:00
parent c933bb7e37
commit ffa7bac6f5

View File

@ -1098,6 +1098,9 @@ fifo_segment_msg_q_alloc (fifo_segment_t *fs, u32 mq_index,
size = svm_msg_q_size_to_alloc (cfg);
base = fsh_alloc_aligned (fsh, size, 8);
if (!base)
return 0;
fsh->n_reserved_bytes += size;
smq = svm_msg_q_init (base, cfg);