summaryrefslogtreecommitdiff
path: root/drivers/dahdi/tor2.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2008-11-25 19:59:15 +0000
committerShaun Ruffell <sruffell@digium.com>2008-11-25 19:59:15 +0000
commit4f75996bcee4e9aba5b1267c9c7967156bf1bcf7 (patch)
tree9b54a0f4a86b8c10502aa69619fe651a1c8e4992 /drivers/dahdi/tor2.c
parent304b1949d52a9822170dac7c329e7e8c2ade5c4f (diff)
Validate that the span priority is valid in the tor2 driver.
Patch provided by tzafrir. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5383 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/tor2.c')
-rw-r--r--drivers/dahdi/tor2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/dahdi/tor2.c b/drivers/dahdi/tor2.c
index d89191f..6e443b9 100644
--- a/drivers/dahdi/tor2.c
+++ b/drivers/dahdi/tor2.c
@@ -200,6 +200,11 @@ static int tor2_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
if (debug)
printk(KERN_INFO "Tor2: Configuring span %d\n", span->spanno);
+ if ((lc->sync < 0) || (lc->sync >= MAX_TOR_CARDS)) {
+ printk(KERN_WARNING "%s %d: invalid span timing value %d.\n",
+ THIS_MODULE->name, span->spanno, lc->sync);
+ return -EINVAL;
+ }
span->syncsrc = p->tor->syncsrc;
/* remove this span number from the current sync sources, if there */