diff options
Diffstat (limited to 'sound/core/seq/seq_clientmgr.c')
| -rw-r--r-- | sound/core/seq/seq_clientmgr.c | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index ea2d0ae85bd3..6c9cba2166d9 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -1259,6 +1259,7 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)  	struct snd_seq_port_info *info = arg;  	struct snd_seq_client_port *port;  	struct snd_seq_port_callback *callback; +	int port_idx;  	/* it is not allowed to create the port for an another client */  	if (info->addr.client != client->number) @@ -1269,7 +1270,9 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)  		return -ENOMEM;  	if (client->type == USER_CLIENT && info->kernel) { -		snd_seq_delete_port(client, port->addr.port); +		port_idx = port->addr.port; +		snd_seq_port_unlock(port); +		snd_seq_delete_port(client, port_idx);  		return -EINVAL;  	}  	if (client->type == KERNEL_CLIENT) { @@ -1290,6 +1293,7 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)  	snd_seq_set_port_info(port, info);  	snd_seq_system_client_ev_port_start(port->addr.client, port->addr.port); +	snd_seq_port_unlock(port);  	return 0;  }  | 
