From a3ad32c370dac9fb8d196db7f4d53e2a3f59d1ba Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Fri, 10 May 2013 14:24:11 -0500 Subject: [PATCH] dahdi: Prevent potential error when only switching spantype of single span. If you have a multiple span system configured for t1 mode, and you try to change only the first span from t1 to e1 via sysfs, you could get an error in the kernel log about trying to create duplicate channel. The problem is that the check for whether there was enough room for the all the channels of the switched span was wrong. Reported-by: James Brown Signed-off-by: Shaun Ruffell Signed-off-by: Russ Meyerriecks --- drivers/dahdi/dahdi-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index a3540d1..dda06ef 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -7018,7 +7018,7 @@ static int _assign_spanno_and_basechan(struct dahdi_span *span) } next_channo = _get_next_channo(pos); - if ((basechan + span->channels) >= next_channo) + if ((basechan + span->channels) <= next_channo) break; /* We can't fit here, let's look at the next location. */