aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/mixart/mixart_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/mixart/mixart_core.c')
-rw-r--r--sound/pci/mixart/mixart_core.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c
index 785085e48353..b9a06c279397 100644
--- a/sound/pci/mixart/mixart_core.c
+++ b/sound/pci/mixart/mixart_core.c
@@ -56,8 +56,10 @@ static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame)
56 if (tailptr == headptr) 56 if (tailptr == headptr)
57 return 0; /* no message posted */ 57 return 0; /* no message posted */
58 58
59 snd_assert( tailptr >= MSG_OUTBOUND_POST_STACK, return 0); /* error */ 59 if (tailptr < MSG_OUTBOUND_POST_STACK)
60 snd_assert( tailptr < (MSG_OUTBOUND_POST_STACK+MSG_BOUND_STACK_SIZE), return 0); /* error */ 60 return 0; /* error */
61 if (tailptr >= MSG_OUTBOUND_POST_STACK + MSG_BOUND_STACK_SIZE)
62 return 0; /* error */
61 63
62 *msg_frame = readl_be(MIXART_MEM(mgr, tailptr)); 64 *msg_frame = readl_be(MIXART_MEM(mgr, tailptr));
63 65
@@ -149,7 +151,8 @@ static int send_msg( struct mixart_mgr *mgr,
149 u32 msg_frame_address; 151 u32 msg_frame_address;
150 int err, i; 152 int err, i;
151 153
152 snd_assert(msg->size % 4 == 0, return -EINVAL); 154 if (snd_BUG_ON(msg->size % 4))
155 return -EINVAL;
153 156
154 err = 0; 157 err = 0;
155 158
@@ -289,9 +292,12 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
289 wait_queue_t wait; 292 wait_queue_t wait;
290 long timeout; 293 long timeout;
291 294
292 snd_assert(notif_event != 0, return -EINVAL); 295 if (snd_BUG_ON(!notif_event))
293 snd_assert((notif_event & MSG_TYPE_MASK) == MSG_TYPE_NOTIFY, return -EINVAL); 296 return -EINVAL;
294 snd_assert((notif_event & MSG_CANCEL_NOTIFY_MASK) == 0, return -EINVAL); 297 if (snd_BUG_ON((notif_event & MSG_TYPE_MASK) != MSG_TYPE_NOTIFY))
298 return -EINVAL;
299 if (snd_BUG_ON(notif_event & MSG_CANCEL_NOTIFY_MASK))
300 return -EINVAL;
295 301
296 mutex_lock(&mgr->msg_mutex); 302 mutex_lock(&mgr->msg_mutex);
297 303