Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0654ba9 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Revert "ALSA: seq: Protect in-kernel ioctl calls with mutex"



This reverts commit feb68902.

The fix attempt was incorrect, leading to the mutex deadlock through
the close of OSS sequencer client.  The proper fix needs more
consideration, so let's revert it now.

Fixes: feb68902 ("ALSA: seq: Protect in-kernel ioctl calls with mutex")
Reported-by: default avatar <syzbot+47ded6c0f23016cde310@syzkaller.appspotmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 5d704b0d
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -2334,19 +2334,14 @@ int snd_seq_kernel_client_ctl(int clientid, unsigned int cmd, void *arg)
{
	const struct ioctl_handler *handler;
	struct snd_seq_client *client;
	int err;

	client = clientptr(clientid);
	if (client == NULL)
		return -ENXIO;

	for (handler = ioctl_handlers; handler->cmd > 0; ++handler) {
		if (handler->cmd == cmd) {
			mutex_lock(&client->ioctl_mutex);
			err = handler->func(client, arg);
			mutex_unlock(&client->ioctl_mutex);
			return err;
		}
		if (handler->cmd == cmd)
			return handler->func(client, arg);
	}

	pr_debug("ALSA: seq unknown ioctl() 0x%x (type='%c', number=0x%02x)\n",