summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xzaptel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/zaptel.c b/zaptel.c
index 05c8b26..59ab714 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -2563,14 +2563,15 @@ static int zt_timer_ioctl(struct inode *node, struct file *file, unsigned int cm
spin_unlock_irqrestore(&zaptimerlock, flags);
break;
case ZT_GETEVENT: /* Get event on queue */
+ j = ZT_EVENT_NONE;
spin_lock_irqsave(&zaptimerlock, flags);
/* set up for no event */
- put_user(ZT_EVENT_NONE,(int *)data);
if (timer->tripped)
- put_user(ZT_EVENT_TIMER_EXPIRED, (int *)data);
+ j = ZT_EVENT_TIMER_EXPIRED;
if (timer->ping)
- put_user(ZT_EVENT_TIMER_PING, (int *)data);
+ j = ZT_EVENT_TIMER_PING;
spin_unlock_irqrestore(&zaptimerlock, flags);
+ put_user(j,(int *)data);
break;
case ZT_TIMERPING:
spin_lock_irqsave(&zaptimerlock, flags);
@@ -3292,8 +3293,8 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
return (rv);
break;
case ZT_FLUSH: /* flush input buffer, output buffer, and/or event queue */
- spin_lock_irqsave(&chan->lock, flags);
get_user(i,(int *)data); /* get param */
+ spin_lock_irqsave(&chan->lock, flags);
if (i & ZT_FLUSH_READ) /* if for read (input) */
{
/* initialize read buffers and pointers */