|
|
@@ -2343,14 +2343,19 @@ 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)
|
|
|
- return handler->func(client, arg);
|
|
|
+ if (handler->cmd == cmd) {
|
|
|
+ mutex_lock(&client->ioctl_mutex);
|
|
|
+ err = handler->func(client, arg);
|
|
|
+ mutex_unlock(&client->ioctl_mutex);
|
|
|
+ return err;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
pr_debug("ALSA: seq unknown ioctl() 0x%x (type='%c', number=0x%02x)\n",
|