提交 ea31ed26 编写于 作者: J Jia Zhou 提交者: Zheng Zengkai

ALSA: core: remove redundant spin_lock pair in snd_card_disconnect

stable inclusion
from stable-5.10.37
commit 897c095c7e9ea3c20875f7d6ff626f8455d3324e
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit abc21649 ]

modification in commit 2a3f7221 ("ALSA: core: Fix card races between
register and disconnect") resulting in this problem.

Fixes: 2a3f7221 ("ALSA: core: Fix card races between register and disconnect")
Signed-off-by: NJia Zhou <zhou.jia2@zte.com.cn>
Signed-off-by: NYi Wang <wang.yi59@zte.com.cn>
Link: https://lore.kernel.org/r/1616989007-34429-1-git-send-email-wang.yi59@zte.com.cnSigned-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 c29e668a
...@@ -390,10 +390,8 @@ int snd_card_disconnect(struct snd_card *card) ...@@ -390,10 +390,8 @@ int snd_card_disconnect(struct snd_card *card)
return 0; return 0;
} }
card->shutdown = 1; card->shutdown = 1;
spin_unlock(&card->files_lock);
/* replace file->f_op with special dummy operations */ /* replace file->f_op with special dummy operations */
spin_lock(&card->files_lock);
list_for_each_entry(mfile, &card->files_list, list) { list_for_each_entry(mfile, &card->files_list, list) {
/* it's critical part, use endless loop */ /* it's critical part, use endless loop */
/* we have no room to fail */ /* we have no room to fail */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册