[dahdi-commits] tzafrir: linux/trunk r7850 - /linux/trunk/drivers/dahdi/dahdi-base.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Mon Jan 11 08:50:07 CST 2010
Author: tzafrir
Date: Mon Jan 11 08:50:04 2010
New Revision: 7850
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7850
Log:
Fail gracefully if we already have more than 1024 channels.
Modified:
linux/trunk/drivers/dahdi/dahdi-base.c
Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=7850&r1=7849&r2=7850
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Mon Jan 11 08:50:04 2010
@@ -5723,6 +5723,7 @@
int dahdi_register(struct dahdi_span *span, int prefmaster)
{
int x;
+ int res = 0;
if (!span)
return -EINVAL;
@@ -5768,7 +5769,12 @@
for (x = 0; x < span->channels; x++) {
span->chans[x]->span = span;
- dahdi_chan_reg(span->chans[x]);
+ res = dahdi_chan_reg(span->chans[x]);
+ if (res) {
+ for (x--; x >= 0; x--)
+ dahdi_chan_unreg(span->chans[x]);
+ goto unreg_channels;
+ }
}
#ifdef CONFIG_PROC_FS
@@ -5804,6 +5810,10 @@
}
return 0;
+
+unreg_channels:
+ spans[span->spanno] = NULL;
+ return res;
}
More information about the dahdi-commits
mailing list