diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-11-25 20:59:19 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2008-11-25 20:59:19 +0000 |
commit | 8623c62b7709991b5f7c667e6696d046eb9c9b63 (patch) | |
tree | cde317e7e2b29e4f967eac7c53cea7aa8a1b9f3f | |
parent | 901f14330c05bd7b5c8856b6ca4503d910b0c5f5 (diff) |
Fixing issue #13954 in zaptel 1.2.svn_1.2
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@4587 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r-- | tor2.c | 7 | ||||
-rw-r--r-- | torisa.c | 7 | ||||
-rw-r--r-- | wct1xxp.c | 2 | ||||
-rw-r--r-- | wcte11xp.c | 2 |
4 files changed, 16 insertions, 2 deletions
@@ -203,6 +203,13 @@ static int tor2_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) if (debug) printk("Tor2: Configuring span %d\n", span->spanno); + + if ((lc->sync < 0) || (lc->sync >= SPANS_PER_CARD)) { + printk(KERN_WARNING "%s %d: invalid span timing value %d.\n", + THIS_MODULE->name, span->spanno, lc->sync); + return -EINVAL; + } + /* XXX We assume lineconfig is okay and shouldn't XXX */ span->lineconfig = lc->lineconfig; span->txlevel = lc->lbo; @@ -602,6 +602,13 @@ static int torisa_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) { if (debug) printk("TorISA: Configuring span %d\n", span->spanno); + + if ((lc->sync < 0) || (lc->sync >= 2)) { + printk(KERN_WARNING "%s %d: invalid span timing value %d.\n", + THIS_MODULE->name, span->spanno, lc->sync); + return -EINVAL; + } + /* XXX We assume lineconfig is okay and shouldn't XXX */ span->lineconfig = lc->lineconfig; span->txlevel = lc->lbo; @@ -738,7 +738,7 @@ static int t1xxp_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) span->txlevel = lc->lbo; span->rxlevel = 0; /* Do we want to SYNC on receive or not */ - wc->sync = lc->sync; + wc->sync = (lc->sync) ? 1 : 0; /* If already running, apply changes immediately */ if (span->flags & ZT_FLAG_RUNNING) return t1xxp_startup(span); @@ -932,7 +932,7 @@ static int t1xxp_spanconfig(struct zt_span *span, struct zt_lineconfig *lc) span->txlevel = lc->lbo; span->rxlevel = 0; /* Do we want to SYNC on receive or not */ - wc->sync = lc->sync; + wc->sync = (lc->sync) ? 1 : 0; /* If already running, apply changes immediately */ if (span->flags & ZT_FLAG_RUNNING) return t1xxp_startup(span); |