mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 13:03:25 +01:00
ASoC: wm_adsp: Fix missing mutex_lock in wm_adsp_write_ctl()
wm_adsp_write_ctl() must hold the pwr_lock mutex when calling cs_dsp_get_ctl(). This was previously partially fixed by commit781118bc2f
("ASoC: wm_adsp: Fix missing locking in wm_adsp_[read|write]_ctl()") but this only put locking around the call to cs_dsp_coeff_write_ctrl(), missing the call to cs_dsp_get_ctl(). Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes:781118bc2f
("ASoC: wm_adsp: Fix missing locking in wm_adsp_[read|write]_ctl()") Link: https://msgid.link/r/20240307110227.41421-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
96e202f8c5
commit
f193957b0f
1 changed files with 2 additions and 1 deletions
|
@ -683,11 +683,12 @@ static void wm_adsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl)
|
|||
int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type,
|
||||
unsigned int alg, void *buf, size_t len)
|
||||
{
|
||||
struct cs_dsp_coeff_ctl *cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg);
|
||||
struct cs_dsp_coeff_ctl *cs_ctl;
|
||||
struct wm_coeff_ctl *ctl;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&dsp->cs_dsp.pwr_lock);
|
||||
cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg);
|
||||
ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, buf, len);
|
||||
mutex_unlock(&dsp->cs_dsp.pwr_lock);
|
||||
|
||||
|
|
Loading…
Reference in a new issue