Skip to content

Commit 7c6ddc1

Browse files
committed
ASoC: SOF: sof-client-probes: Protection against removal while in use
Make sure that the core (the device driver for the DSP) can not be removed while the compress stream is running. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 59d4c54 commit 7c6ddc1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

sound/soc/sof/sof-client-probes.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,15 @@ static int sof_probes_compr_startup(struct snd_compr_stream *cstream,
262262
const struct sof_probes_host_ops *ops = priv->host_ops;
263263
int ret;
264264

265+
ret = sof_client_core_module_get(cdev);
266+
if (ret)
267+
return ret;
268+
265269
ret = ops->assign(cdev, cstream, dai, &priv->extractor_stream_tag);
266270
if (ret) {
267271
dev_err(dai->dev, "Failed to assign probe stream: %d\n", ret);
268272
priv->extractor_stream_tag = SOF_PROBES_INVALID_NODE_ID;
273+
sof_client_core_module_put(cdev);
269274
}
270275

271276
return ret;
@@ -301,7 +306,11 @@ static int sof_probes_compr_shutdown(struct snd_compr_stream *cstream,
301306
priv->extractor_stream_tag = SOF_PROBES_INVALID_NODE_ID;
302307
snd_compr_free_pages(cstream);
303308

304-
return ops->free(cdev, cstream, dai);
309+
ret = ops->free(cdev, cstream, dai);
310+
311+
sof_client_core_module_put(cdev);
312+
313+
return ret;
305314
}
306315

307316
static int sof_probes_compr_set_params(struct snd_compr_stream *cstream,

0 commit comments

Comments
 (0)