diff options
Diffstat (limited to 'sound/core/seq/seq_queue.c')
-rw-r--r-- | sound/core/seq/seq_queue.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c index 450c5187eecb..79e0c5604ef8 100644 --- a/sound/core/seq/seq_queue.c +++ b/sound/core/seq/seq_queue.c | |||
@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void) | |||
184 | static void queue_use(struct snd_seq_queue *queue, int client, int use); | 184 | static void queue_use(struct snd_seq_queue *queue, int client, int use); |
185 | 185 | ||
186 | /* allocate a new queue - | 186 | /* allocate a new queue - |
187 | * return queue index value or negative value for error | 187 | * return pointer to new queue or ERR_PTR(-errno) for error |
188 | * The new queue's use_lock is set to 1. It is the caller's responsibility to | ||
189 | * call snd_use_lock_free(&q->use_lock). | ||
188 | */ | 190 | */ |
189 | int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) | 191 | struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags) |
190 | { | 192 | { |
191 | struct snd_seq_queue *q; | 193 | struct snd_seq_queue *q; |
192 | 194 | ||
193 | q = queue_new(client, locked); | 195 | q = queue_new(client, locked); |
194 | if (q == NULL) | 196 | if (q == NULL) |
195 | return -ENOMEM; | 197 | return ERR_PTR(-ENOMEM); |
196 | q->info_flags = info_flags; | 198 | q->info_flags = info_flags; |
197 | queue_use(q, client, 1); | 199 | queue_use(q, client, 1); |
200 | snd_use_lock_use(&q->use_lock); | ||
198 | if (queue_list_add(q) < 0) { | 201 | if (queue_list_add(q) < 0) { |
202 | snd_use_lock_free(&q->use_lock); | ||
199 | queue_delete(q); | 203 | queue_delete(q); |
200 | return -ENOMEM; | 204 | return ERR_PTR(-ENOMEM); |
201 | } | 205 | } |
202 | return q->queue; | 206 | return q; |
203 | } | 207 | } |
204 | 208 | ||
205 | /* delete a queue - queue must be owned by the client */ | 209 | /* delete a queue - queue must be owned by the client */ |