diff options
author | Kinsey Moore <kmoore@digium.com> | 2011-04-15 18:42:16 +0000 |
---|---|---|
committer | Kinsey Moore <kmoore@digium.com> | 2011-04-15 18:42:16 +0000 |
commit | 41082a8da7641045dd228edf61fbd73753466aa2 (patch) | |
tree | 6f078f2b789c30dc388a1fc5ae173c06307792d9 /drivers | |
parent | e381a17fb7190696984eca6b8707fb53d671e812 (diff) |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 4 |
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); |