summaryrefslogtreecommitdiff
path: root/tor2.c
diff options
context:
space:
mode:
Diffstat (limited to 'tor2.c')
-rw-r--r--tor2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tor2.c b/tor2.c
index c662cc1..a52c2e4 100644
--- a/tor2.c
+++ b/tor2.c
@@ -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;