From ea31ed265bb91b33f03d963e68b0aacd716a69ad Mon Sep 17 00:00:00 2001 From: Jia Zhou Date: Mon, 24 May 2021 12:10:10 +0000 Subject: [PATCH] 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 abc21649b3e5c34b143bf86f0c78e33d5815e250 ] modification in commit 2a3f7221acdd ("ALSA: core: Fix card races between register and disconnect") resulting in this problem. Fixes: 2a3f7221acdd ("ALSA: core: Fix card races between register and disconnect") Signed-off-by: Jia Zhou Signed-off-by: Yi Wang Link: https://lore.kernel.org/r/1616989007-34429-1-git-send-email-wang.yi59@zte.com.cn Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin Signed-off-by: Chen Jun Acked-by: Weilong Chen Signed-off-by: Zheng Zengkai --- sound/core/init.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/core/init.c b/sound/core/init.c index 018ce4ef12ec..9f5270c90a10 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -390,10 +390,8 @@ int snd_card_disconnect(struct snd_card *card) return 0; } card->shutdown = 1; - spin_unlock(&card->files_lock); /* replace file->f_op with special dummy operations */ - spin_lock(&card->files_lock); list_for_each_entry(mfile, &card->files_list, list) { /* it's critical part, use endless loop */ /* we have no room to fail */ -- GitLab