[svn-commits] sruffell: branch linux/sruffell/chan_list_refactoring r9272 - /linux/team/sru...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Sep 2 12:41:16 CDT 2010
Author: sruffell
Date: Thu Sep 2 12:41:04 2010
New Revision: 9272
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9272
Log:
dahdi: Reduce chans array indexing in dahdi_chan_unreg.
Modified:
linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c
Modified: linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c?view=diff&rev=9272&r1=9271&r2=9272
==============================================================================
--- linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/sruffell/chan_list_refactoring/drivers/dahdi/dahdi-base.c Thu Sep 2 12:41:04 2010
@@ -2070,29 +2070,32 @@
}
#endif
maxchans = 0;
- for (x=1;x<DAHDI_MAX_CHANNELS;x++)
- if (chans[x]) {
- maxchans = x + 1;
- /* Remove anyone pointing to us as master
- and make them their own thing */
- if (chans[x]->master == chan) {
- chans[x]->master = chans[x];
+ for (x = 1; x < DAHDI_MAX_CHANNELS; x++) {
+ struct dahdi_chan *const pos = chans[x];
+ if (!pos)
+ continue;
+ maxchans = x + 1;
+ /* Remove anyone pointing to us as master
+ and make them their own thing */
+ if (pos->master == chan)
+ pos->master = pos;
+
+ if ((pos->confna == chan->channo) &&
+ is_monitor_mode(pos->confmode) &&
+ ((pos->confmode & DAHDI_CONF_MODE_MASK) ==
+ DAHDI_CONF_DIGITALMON)) {
+ /* Take them out of conference with us */
+ /* release conference resource if any */
+ if (pos->confna) {
+ dahdi_check_conf(pos->confna);
+ if (pos->span)
+ dahdi_disable_dacs(pos);
}
- if ((chans[x]->confna == chan->channo) &&
- is_monitor_mode(chans[x]->confmode) &&
- ((chans[x]->confmode & DAHDI_CONF_MODE_MASK) == DAHDI_CONF_DIGITALMON)) {
- /* Take them out of conference with us */
- /* release conference resource if any */
- if (chans[x]->confna) {
- dahdi_check_conf(chans[x]->confna);
- if (chans[x]->span)
- dahdi_disable_dacs(chans[x]);
- }
- chans[x]->confna = 0;
- chans[x]->_confn = 0;
- chans[x]->confmode = 0;
- }
- }
+ pos->confna = 0;
+ pos->_confn = 0;
+ pos->confmode = 0;
+ }
+ }
chan->channo = -1;
write_unlock_irqrestore(&chan_lock, flags);
}
More information about the svn-commits
mailing list