]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Fix component lists locking
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 7 Mar 2015 18:34:03 +0000 (19:34 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 8 Mar 2015 19:45:55 +0000 (19:45 +0000)
commita4347198ca78eb2fabbea792420cc9771e8550ba
treebfa14af667c5c08972cbd2c5189979b2acc79ac8
parent9cbe621030a9cce16d27329dac74fd4b1c1d9412
ASoC: Fix component lists locking

Any access to the component_list, codec_list and platform_list needs to be
properly locked by the client_mutex. Otherwise undefined behavior can occur
if the list is modified in one thread and concurrently accessed from another
thread.

This patch adds the missing locking to the debugfs file handlers that
display the registered components, as well as the various components
unregister functions.

Furthermore the client_lock is now held for the whole
snd_soc_instantiate_card() sequence to make sure that component removal does
not race against the card registration.

Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c