diff options
| author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2022-04-12 11:16:28 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-09 10:20:51 +0200 |
| commit | e2b8681769f6e205382f026b907d28aa5ec9d59a (patch) | |
| tree | aba571e7fc5a1543422332f26a232e6fdf5f029b /include/sound | |
| parent | 005990e30d14b1d70eceaaf712c413046be3b2d6 (diff) | |
| download | linux-e2b8681769f6e205382f026b907d28aa5ec9d59a.tar.gz linux-e2b8681769f6e205382f026b907d28aa5ec9d59a.tar.bz2 linux-e2b8681769f6e205382f026b907d28aa5ec9d59a.zip | |
ALSA: jack: Access input_dev under mutex
[ Upstream commit 1b6a6fc5280e97559287b61eade2d4b363e836f2 ]
It is possible when using ASoC that input_dev is unregistered while
calling snd_jack_report, which causes NULL pointer dereference.
In order to prevent this serialize access to input_dev using mutex lock.
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220412091628.3056922-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/sound')
| -rw-r--r-- | include/sound/jack.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/jack.h b/include/sound/jack.h index 9eb2b5ec1ec4..78f3619f3de9 100644 --- a/include/sound/jack.h +++ b/include/sound/jack.h @@ -62,6 +62,7 @@ struct snd_jack { const char *id; #ifdef CONFIG_SND_JACK_INPUT_DEV struct input_dev *input_dev; + struct mutex input_dev_lock; int registered; int type; char name[100]; |
