From fcd4db20d13fe27cc655b9bff177be32cc2d8dd5 Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Fri, 15 Apr 2011 18:42:16 +0000 Subject: [PATCH] dahdi: Bug fix for enabling buffer events Introduced in rev 9905, this bug could cause buffer events to become disabled if the kernel was unable to access userland data. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9907 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);