mixer: prevent NULL dereference

User IPC can provide an invalid component ID, this shouldn't lead to
a NULL dereference.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2022-01-24 11:58:03 +01:00 committed by Liam Girdwood
parent cc5d6efe53
commit 6f50f85633
1 changed files with 5 additions and 0 deletions

View File

@ -730,6 +730,11 @@ static int mixin_bind(struct comp_dev *dev, void *data)
struct list_item *blist;
sink = ipc4_get_comp_dev(sink_id);
if (!sink) {
comp_err(dev, "mixin_bind: no sink with ID %d found", sink_id);
return -EINVAL;
}
list_for_item(blist, &sink->bsource_list) {
sink_buf = container_of(blist, struct comp_buffer, sink_list);
if (sink_buf->source == dev) {