[PATCH 4.14 200/323] ALSA: core: remove redundant spin_lock pair in snd_card_disconnect

From: Greg Kroah-Hartman
Date: Thu May 20 2021 - 06:46:46 EST


From: Jia Zhou <zhou.jia2@xxxxxxxxxx>

[ 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 <zhou.jia2@xxxxxxxxxx>
Signed-off-by: Yi Wang <wang.yi59@xxxxxxxxxx>
Link: https://lore.kernel.org/r/1616989007-34429-1-git-send-email-wang.yi59@xxxxxxxxxx
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
sound/core/init.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/sound/core/init.c b/sound/core/init.c
index dcb9199f5e4f..7fdeae4dc820 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -404,10 +404,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 */
--
2.30.2