Skip to content

Commit

Permalink
smart_amp_test: fix unbind implementation
Browse files Browse the repository at this point in the history
Code in unbind is looking at wrong field for queue-id. This works
some of the time, but in some cases leads to access to freed
heap data and later to heap corruption.

Link: #7191
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
  • Loading branch information
kv2019i committed Apr 18, 2023
1 parent 2512698 commit 36fc4d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/samples/audio/smart_amp_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static int smart_amp_unbind(struct comp_dev *dev, void *data)

comp_dbg(dev, "smart_amp_unbind()");

if (bu->extension.r.dst_instance_id == SOF_SMART_AMP_FEEDBACK_QUEUE_ID) {
if (bu->extension.r.dst_queue == SOF_SMART_AMP_FEEDBACK_QUEUE_ID) {
k_mutex_lock(&sad->lock, K_FOREVER);
sad->feedback_buf = NULL;
k_mutex_unlock(&sad->lock);
Expand Down

0 comments on commit 36fc4d6

Please sign in to comment.