summaryrefslogtreecommitdiff
path: root/sound/soc/sof/sof-client-probes-ipc4.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sof/sof-client-probes-ipc4.c')
-rw-r--r--sound/soc/sof/sof-client-probes-ipc4.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/sof/sof-client-probes-ipc4.c b/sound/soc/sof/sof-client-probes-ipc4.c
index ea21ef176c42..c56a85854d92 100644
--- a/sound/soc/sof/sof-client-probes-ipc4.c
+++ b/sound/soc/sof/sof-client-probes-ipc4.c
@@ -146,6 +146,9 @@ static int ipc4_probes_deinit(struct sof_client_dev *cdev)
struct sof_man4_module *mentry = sof_ipc4_probe_get_module_info(cdev);
struct sof_ipc4_msg msg;
+ if (!mentry)
+ return -ENODEV;
+
msg.primary = mentry->id;
msg.primary |= SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_MOD_DELETE_INSTANCE);
msg.primary |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST);
@@ -197,6 +200,9 @@ static int ipc4_probes_points_add(struct sof_client_dev *cdev,
struct sof_ipc4_msg msg;
int i, ret;
+ if (!mentry)
+ return -ENODEV;
+
/* The sof_probe_point_desc and sof_ipc4_probe_point structs
* are of same size and even the integers are the same in the
* same order, and similar meaning, but since there is no
@@ -247,6 +253,9 @@ static int ipc4_probes_points_remove(struct sof_client_dev *cdev,
u32 *probe_point_ids;
int i, ret;
+ if (!mentry)
+ return -ENODEV;
+
probe_point_ids = kcalloc(num_buffer_id, sizeof(*probe_point_ids),
GFP_KERNEL);
if (!probe_point_ids)