* [PATCH] ASoC: SOF: ipc4: check return value of snd_sof_ipc_msg_data
@ 2023-11-29 12:20 Peter Ujfalusi
2023-11-29 18:52 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2023-11-29 12:20 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: alsa-devel, linux-sound, pierre-louis.bossart, kai.vehmanen,
ranjani.sridharan, yung-chuan.liao
From: Bard Liao <yung-chuan.liao@linux.intel.com>
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>
---
sound/soc/sof/ipc4.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
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 */
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: SOF: ipc4: check return value of snd_sof_ipc_msg_data
2023-11-29 12:20 [PATCH] ASoC: SOF: ipc4: check return value of snd_sof_ipc_msg_data Peter Ujfalusi
@ 2023-11-29 18:52 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2023-11-29 18:52 UTC (permalink / raw)
To: lgirdwood, Peter Ujfalusi
Cc: alsa-devel, linux-sound, pierre-louis.bossart, kai.vehmanen,
ranjani.sridharan, yung-chuan.liao
On Wed, 29 Nov 2023 14:20:21 +0200, Peter Ujfalusi wrote:
> snd_sof_ipc_msg_data could return error.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: ipc4: check return value of snd_sof_ipc_msg_data
commit: 2bd512626f8ea3957c981cadd2ebf75feff737dd
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-29 18:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-29 12:20 [PATCH] ASoC: SOF: ipc4: check return value of snd_sof_ipc_msg_data Peter Ujfalusi
2023-11-29 18:52 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox