summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/dahdi/dahdi-base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 5c57b2c..029c928 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -6279,7 +6279,9 @@ static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long d
break;
#endif
case DAHDI_BUFFER_EVENTS:
- if (get_user(j, (int __user *)data) != -EFAULT && j)
+ if (get_user(j, (int __user *)data))
+ return -EFAULT;
+ if (j)
set_bit(DAHDI_FLAGBIT_BUFEVENTS, &chan->flags);
else
clear_bit(DAHDI_FLAGBIT_BUFEVENTS, &chan->flags);