ALSA: jack: Access input_dev under mutex
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Tue, 12 Apr 2022 09:16:28 +0000 (11:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:32 +0000 (10:22 +0200)
commit5cc6f623f4818c7d7e9e966a45ebf324901ca9c5
treeab005f7f01890b7efac8d876f4750222d22794ef
parent64e9f4f65c945b8eb6f4b2a7d0312150b4b8d7d8
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>
include/sound/jack.h
sound/core/jack.c