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>
Tue, 14 Jun 2022 14:53:44 +0000 (16:53 +0200)
commit8487a88136d54a1a4d3f26f1399685db648ab879
tree4860b972f960ab9910a126c6a67758960c8550d4
parent209a3aef829a67e9256f7d00e3431f86b1da2567
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