From 747a02cd78e732c660c5cfe7e6d3eb34db23790f Mon Sep 17 00:00:00 2001 From: Andrey Borisovich Date: Wed, 10 May 2023 12:35:34 +0200 Subject: [PATCH] ipc4: fixed possible null dereference Result of the function call ipc_get_comp_by_id() had been dereferenced without checking whether the pointer may be null. Returned pointer may be null when component does not exist on the list. Signed-off-by: Andrey Borisovich --- src/ipc/ipc4/helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 9f49b58c5efe..78d05872abbd 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -632,6 +632,8 @@ int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id) int ret; ipc_pipe = ipc_get_pipeline_by_id(ipc, comp_id); + if (!ipc_pipe) + return -IPC4_INVALID_RESOURCE_ID; /* Pass IPC to target core */ if (!cpu_is_me(ipc_pipe->core))