ALSA: fireface: fix locking bug in ff400_copy_msg_to_user()
authorDan Carpenter <error27@gmail.com>
Tue, 17 Jan 2023 14:17:29 +0000 (17:17 +0300)
committerTakashi Iwai <tiwai@suse.de>
Wed, 18 Jan 2023 16:49:48 +0000 (17:49 +0100)
commit81c254a65ceb2770bc3cd87bd172a29d8ae92dc4
tree9fa190159e2183867072750dceca7852abd9c4de
parent3ee0fe7fa39b14d1cea455b7041f2df933bd97d2
ALSA: fireface: fix locking bug in ff400_copy_msg_to_user()

The ff400_copy_msg_to_user() function drops the spin lock to call
copy_to_user().  However, if the copy_to_user() fails, then it must
take the lock again before returning.  Failure to take the lock leads
to a double unlock in the caller, hwdep_read().

Fixes: acdebd8b4c0c ("ALSA: fireface: implement message parser for Fireface 400")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/Y8at+W/7OGvEBY8O@kili
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/fireface/ff-protocol-former.c