diff options
author | Shaun Ruffell <sruffell@digium.com> | 2008-11-25 19:59:15 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2008-11-25 19:59:15 +0000 |
commit | 8de1c75df0455f69a5f9a2e877ad788dbe82f1d7 (patch) | |
tree | 9b54a0f4a86b8c10502aa69619fe651a1c8e4992 /drivers/dahdi/tor2.c | |
parent | e21f64ed359901c1c4f44cae09ab8fc7d3b83f99 (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.c | 5 |
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 */ |