summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/ipc4.c
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2023-11-29 14:20:21 +0200
committerMark Brown <broonie@kernel.org>2023-11-29 13:25:25 +0000
commit2bd512626f8ea3957c981cadd2ebf75feff737dd (patch)
tree459d8d96cda5062fc063cac88911dd4079038b3c /sound/soc/sof/ipc4.c
parent8c91ca76f44804868d12aed20ebdbc2f89aa7d60 (diff)
downloadlinux-stable-2bd512626f8ea3957c981cadd2ebf75feff737dd.tar.gz
linux-stable-2bd512626f8ea3957c981cadd2ebf75feff737dd.tar.bz2
linux-stable-2bd512626f8ea3957c981cadd2ebf75feff737dd.zip
ASoC: SOF: ipc4: check return value of snd_sof_ipc_msg_data
snd_sof_ipc_msg_data could return error. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20231129122021.679-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ipc4.c')
-rw-r--r--sound/soc/sof/ipc4.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/sof/ipc4.c b/sound/soc/sof/ipc4.c
index a9d9800d2fcc..145d319e041f 100644
--- a/sound/soc/sof/ipc4.c
+++ b/sound/soc/sof/ipc4.c
@@ -713,7 +713,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 */