Skip to content

Commit f193957

Browse files
rfvirgilbroonie
authored andcommitted
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 commit 781118b ("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 <[email protected]> Fixes: 781118b ("ASoC: wm_adsp: Fix missing locking in wm_adsp_[read|write]_ctl()") Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 96e202f commit f193957

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/soc/codecs/wm_adsp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,12 @@ static void wm_adsp_control_remove(struct cs_dsp_coeff_ctl *cs_ctl)
683683
int wm_adsp_write_ctl(struct wm_adsp *dsp, const char *name, int type,
684684
unsigned int alg, void *buf, size_t len)
685685
{
686-
struct cs_dsp_coeff_ctl *cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg);
686+
struct cs_dsp_coeff_ctl *cs_ctl;
687687
struct wm_coeff_ctl *ctl;
688688
int ret;
689689

690690
mutex_lock(&dsp->cs_dsp.pwr_lock);
691+
cs_ctl = cs_dsp_get_ctl(&dsp->cs_dsp, name, type, alg);
691692
ret = cs_dsp_coeff_write_ctrl(cs_ctl, 0, buf, len);
692693
mutex_unlock(&dsp->cs_dsp.pwr_lock);
693694

0 commit comments

Comments
 (0)