From: Peter Ujfalusi Date: Tue, 5 Apr 2022 17:27:02 +0000 (-0700) Subject: ASoC: SOF: ipc: Add check for mandatory IPC message handling ops X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=defad9d2e2703b040c3a001978c09c75970357f0;p=linux.git ASoC: SOF: ipc: Add check for mandatory IPC message handling ops Make sure that the mandatory IPC message handling ops are provided by the IPC implementation. Signed-off-by: Peter Ujfalusi Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220405172708.122168-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index 4966a2a41704c..d11c5e6e57fbd 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -1066,6 +1066,11 @@ struct snd_sof_ipc *snd_sof_ipc_init(struct snd_sof_dev *sdev) ops = ipc->ops; /* check for mandatory ops */ + if (!ops->tx_msg || !ops->rx_msg || !ops->set_get_data || !ops->get_reply) { + dev_err(sdev->dev, "Missing IPC message handling ops\n"); + return NULL; + } + if (!ops->pcm) { dev_err(sdev->dev, "Missing IPC PCM ops\n"); return NULL;