mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
audio: add lock for resampler [1/1]
PD#SWPL-8134 Problem: kernel NULL pointer for aml_resample_enable Solution: add lock for resampler Verify: Need stress test for x301 Change-Id: I1bbf5d7aeab681399c93f0cba9cc59195d3be0d6 Signed-off-by: Shuai Li <shuai.li@amlogic.com>
This commit is contained in:
@@ -655,8 +655,13 @@ void aml_set_resample(enum resample_idx id,
|
|||||||
p_attach_resample->id = id;
|
p_attach_resample->id = id;
|
||||||
p_attach_resample->attach_module = resample_module;
|
p_attach_resample->attach_module = resample_module;
|
||||||
|
|
||||||
|
mutex_lock(&ddr_mutex);
|
||||||
to = fetch_toddr_by_src(
|
to = fetch_toddr_by_src(
|
||||||
p_attach_resample->attach_module);
|
p_attach_resample->attach_module);
|
||||||
|
if (to == NULL) {
|
||||||
|
pr_info("%s(), toddr NULL\n", __func__);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
if ((p_attach_resample->status == DISABLED)
|
if ((p_attach_resample->status == DISABLED)
|
||||||
@@ -679,6 +684,9 @@ void aml_set_resample(enum resample_idx id,
|
|||||||
|
|
||||||
if (update_running && to)
|
if (update_running && to)
|
||||||
aml_resample_enable(to, p_attach_resample, enable);
|
aml_resample_enable(to, p_attach_resample, enable);
|
||||||
|
|
||||||
|
exit:
|
||||||
|
mutex_unlock(&ddr_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user