summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-06-02 20:01:49 +0000
committerShaun Ruffell <sruffell@digium.com>2011-06-02 20:01:49 +0000
commitda4fb491de5e3b51407f5902b0bc78c2286e890a (patch)
tree64a460a242f119ddf3569c51bdc107c151903efa /drivers/dahdi/dahdi-base.c
parent914882bb844f05c3e1e7bd23b570abc55838a6df (diff)
dahdi: Do not allow 'hwec' to be attached to channels that do not have one.
This defines a NULL value for the name of an echocan as invalid. This will allow dahdi_genconf to probe for the presence of a hardware echocan on a channel by trying to attach one. If there is not a hardware echocan available DAHDI_ATTACH_ECHOCAN ioctl will return -EINVAL if 'hwec' was specified as the name of the echo canceler now. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9943 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r--drivers/dahdi/dahdi-base.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index 2680b71..bded1c0 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -4904,6 +4904,11 @@ static int dahdi_ioctl_attach_echocan(unsigned long data)
new = find_echocan(ae.echocan);
if (!new)
return -EINVAL;
+
+ if (!new->get_name(chan)) {
+ release_echocan(new);
+ return -EINVAL;
+ }
}
spin_lock_irqsave(&chan->lock, flags);