From 1781e78c63317c04e6ae6a076acfd53236f420bc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 16 Jan 2015 13:03:28 +0100 Subject: ALSA: ak411x: Fix race of reinit() calls Protect the call with a mutex, as this may be called in parallel (either from the PCM rate change and the clock change). Acked-by: Jaroslav Kysela Tested-by: Pavel Hofman Signed-off-by: Takashi Iwai --- include/sound/ak4113.h | 1 + include/sound/ak4114.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include/sound') diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h index f4fbf6888e7..58c145620c3 100644 --- a/include/sound/ak4113.h +++ b/include/sound/ak4113.h @@ -287,6 +287,7 @@ struct ak4113 { ak4113_read_t *read; void *private_data; atomic_t wq_processing; + struct mutex reinit_mutex; spinlock_t lock; unsigned char regmap[AK4113_WRITABLE_REGS]; struct snd_kcontrol *kctls[AK4113_CONTROLS]; diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h index e681df2c95e..b6feb7e225f 100644 --- a/include/sound/ak4114.h +++ b/include/sound/ak4114.h @@ -169,6 +169,7 @@ struct ak4114 { ak4114_read_t * read; void * private_data; atomic_t wq_processing; + struct mutex reinit_mutex; spinlock_t lock; unsigned char regmap[6]; unsigned char txcsb[5]; -- cgit v1.2.3-70-g09d2