Skip to content

Commit

Permalink
ipc4: fixed possible null dereference
Browse files Browse the repository at this point in the history
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 <andrey.borisovich@intel.com>
  • Loading branch information
Andrey Borisovich authored and abonislawski committed Aug 26, 2023
1 parent 7b52664 commit 747a02c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ipc/ipc4/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 747a02c

Please sign in to comment.