Don't try to lock/unlock an uninitialized lock on a dahdi_pri.
authorRussell Bryant <russell@russellbryant.com>
Tue, 22 Jun 2010 23:20:37 +0000 (23:20 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 22 Jun 2010 23:20:37 +0000 (23:20 +0000)
This small changes prevents destroy_all_channels() from accessing a lock on an
unused dahdi_pri struct, resolving a ton of ERRORs that get spewed out when
shutting Asterisk down gracefully.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@272052 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 7740ee3..57f45d0 100644 (file)
@@ -5484,6 +5484,9 @@ static void destroy_all_channels(void)
 #if defined(HAVE_PRI)
        /* Destroy all of the no B channel interface lists */
        for (span = 0; span < NUM_SPANS; ++span) {
+               if (!pris[span].dchannels[0]) {
+                       break;
+               }
                pri = &pris[span].pri;
                ast_mutex_lock(&pri->lock);
                while (pri->no_b_chan_iflist) {