]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: core: remove redundant spin_lock pair in snd_card_disconnect
authorJia Zhou <zhou.jia2@zte.com.cn>
Tue, 30 Mar 2021 11:19:23 +0000 (13:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:31 +0000 (09:50 +0200)
[ 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@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
Link: https://lore.kernel.org/r/1616989007-34429-1-git-send-email-wang.yi59@zte.com.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/core/init.c

index 018ce4ef12ec8a2ed90dfc641b8429dff20a05f5..9f5270c90a10a794c8a7f5bb825d1db0db44e417 100644 (file)
@@ -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 */