Skip to content

Commit

Permalink
ASoC: SOF: ipc4: check return value
Browse files Browse the repository at this point in the history
snd_sof_ipc_msg_data could return error.

Signed-off-by: Bard Liao <[email protected]>
  • Loading branch information
bardliao authored and plbossart committed Nov 10, 2023
1 parent 976fea5 commit 776cbce
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sound/soc/sof/ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,14 @@ static void sof_ipc4_rx_msg(struct snd_sof_dev *sdev)
return;

ipc4_msg->data_size = data_size;
snd_sof_ipc_msg_data(sdev, NULL, ipc4_msg->data_ptr, ipc4_msg->data_size);
err = snd_sof_ipc_msg_data(sdev, NULL, ipc4_msg->data_ptr, ipc4_msg->data_size);
if (err < 0) {
dev_err(sdev->dev, "failed to read IPC notification data: %d\n", err);
kfree(ipc4_msg->data_ptr);
ipc4_msg->data_ptr = NULL;
ipc4_msg->data_size = 0;
return;
}
}

/* Handle notifications with payload */
Expand Down

0 comments on commit 776cbce

Please sign in to comment.