aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq_clientmgr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/seq/seq_clientmgr.c')
-rw-r--r--sound/core/seq/seq_clientmgr.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 7a1545d2d953..8ca2be339f3b 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -266,7 +266,8 @@ static int seq_free_client1(struct snd_seq_client *client)
266{ 266{
267 unsigned long flags; 267 unsigned long flags;
268 268
269 snd_assert(client != NULL, return -EINVAL); 269 if (!client)
270 return 0;
270 snd_seq_delete_all_ports(client); 271 snd_seq_delete_all_ports(client);
271 snd_seq_queue_client_leave(client->number); 272 snd_seq_queue_client_leave(client->number);
272 spin_lock_irqsave(&clients_lock, flags); 273 spin_lock_irqsave(&clients_lock, flags);
@@ -403,7 +404,8 @@ static ssize_t snd_seq_read(struct file *file, char __user *buf, size_t count,
403 return -EFAULT; 404 return -EFAULT;
404 405
405 /* check client structures are in place */ 406 /* check client structures are in place */
406 snd_assert(client != NULL, return -ENXIO); 407 if (snd_BUG_ON(!client))
408 return -ENXIO;
407 409
408 if (!client->accept_input || (fifo = client->data.user.fifo) == NULL) 410 if (!client->accept_input || (fifo = client->data.user.fifo) == NULL)
409 return -ENXIO; 411 return -ENXIO;
@@ -825,7 +827,8 @@ int snd_seq_dispatch_event(struct snd_seq_event_cell *cell, int atomic, int hop)
825 struct snd_seq_client *client; 827 struct snd_seq_client *client;
826 int result; 828 int result;
827 829
828 snd_assert(cell != NULL, return -EINVAL); 830 if (snd_BUG_ON(!cell))
831 return -EINVAL;
829 832
830 client = snd_seq_client_use_ptr(cell->event.source.client); 833 client = snd_seq_client_use_ptr(cell->event.source.client);
831 if (client == NULL) { 834 if (client == NULL) {
@@ -994,7 +997,8 @@ static ssize_t snd_seq_write(struct file *file, const char __user *buf,
994 return -ENXIO; 997 return -ENXIO;
995 998
996 /* check client structures are in place */ 999 /* check client structures are in place */
997 snd_assert(client != NULL, return -ENXIO); 1000 if (snd_BUG_ON(!client))
1001 return -ENXIO;
998 1002
999 if (!client->accept_output || client->pool == NULL) 1003 if (!client->accept_output || client->pool == NULL)
1000 return -ENXIO; 1004 return -ENXIO;
@@ -1076,7 +1080,8 @@ static unsigned int snd_seq_poll(struct file *file, poll_table * wait)
1076 unsigned int mask = 0; 1080 unsigned int mask = 0;
1077 1081
1078 /* check client structures are in place */ 1082 /* check client structures are in place */
1079 snd_assert(client != NULL, return -ENXIO); 1083 if (snd_BUG_ON(!client))
1084 return -ENXIO;
1080 1085
1081 if ((snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_INPUT) && 1086 if ((snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_INPUT) &&
1082 client->data.user.fifo) { 1087 client->data.user.fifo) {
@@ -2195,7 +2200,8 @@ static long snd_seq_ioctl(struct file *file, unsigned int cmd, unsigned long arg
2195{ 2200{
2196 struct snd_seq_client *client = file->private_data; 2201 struct snd_seq_client *client = file->private_data;
2197 2202
2198 snd_assert(client != NULL, return -ENXIO); 2203 if (snd_BUG_ON(!client))
2204 return -ENXIO;
2199 2205
2200 return snd_seq_do_ioctl(client, cmd, (void __user *) arg); 2206 return snd_seq_do_ioctl(client, cmd, (void __user *) arg);
2201} 2207}
@@ -2216,7 +2222,8 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
2216 struct snd_seq_client *client; 2222 struct snd_seq_client *client;
2217 va_list args; 2223 va_list args;
2218 2224
2219 snd_assert(! in_interrupt(), return -EBUSY); 2225 if (snd_BUG_ON(in_interrupt()))
2226 return -EBUSY;
2220 2227
2221 if (card && client_index >= SNDRV_SEQ_CLIENTS_PER_CARD) 2228 if (card && client_index >= SNDRV_SEQ_CLIENTS_PER_CARD)
2222 return -EINVAL; 2229 return -EINVAL;
@@ -2265,7 +2272,8 @@ int snd_seq_delete_kernel_client(int client)
2265{ 2272{
2266 struct snd_seq_client *ptr; 2273 struct snd_seq_client *ptr;
2267 2274
2268 snd_assert(! in_interrupt(), return -EBUSY); 2275 if (snd_BUG_ON(in_interrupt()))
2276 return -EBUSY;
2269 2277
2270 ptr = clientptr(client); 2278 ptr = clientptr(client);
2271 if (ptr == NULL) 2279 if (ptr == NULL)
@@ -2288,7 +2296,8 @@ static int kernel_client_enqueue(int client, struct snd_seq_event *ev,
2288 struct snd_seq_client *cptr; 2296 struct snd_seq_client *cptr;
2289 int result; 2297 int result;
2290 2298
2291 snd_assert(ev != NULL, return -EINVAL); 2299 if (snd_BUG_ON(!ev))
2300 return -EINVAL;
2292 2301
2293 if (ev->type == SNDRV_SEQ_EVENT_NONE) 2302 if (ev->type == SNDRV_SEQ_EVENT_NONE)
2294 return 0; /* ignore this */ 2303 return 0; /* ignore this */
@@ -2354,7 +2363,8 @@ int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event * ev,
2354 struct snd_seq_client *cptr; 2363 struct snd_seq_client *cptr;
2355 int result; 2364 int result;
2356 2365
2357 snd_assert(ev != NULL, return -EINVAL); 2366 if (snd_BUG_ON(!ev))
2367 return -EINVAL;
2358 2368
2359 /* fill in client number */ 2369 /* fill in client number */
2360 ev->queue = SNDRV_SEQ_QUEUE_DIRECT; 2370 ev->queue = SNDRV_SEQ_QUEUE_DIRECT;