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)
committerTakashi Iwai <tiwai@suse.de>
Tue, 12 Apr 2022 10:19:05 +0000 (12:19 +0200)
commit1b6a6fc5280e97559287b61eade2d4b363e836f2
tree3654c5b0592641ee7e1dc78b9c71be650dc08d95
parent8f06bd1f89ca8b58dd8c4447b0eeae6ebe63ca0e
ALSA: jack: Access input_dev under mutex

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>
include/sound/jack.h
sound/core/jack.c