[svn-commits] tzafrir: linux/trunk r7066 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 24 12:55:30 CDT 2009


Author: tzafrir
Date: Mon Aug 24 12:55:26 2009
New Revision: 7066

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=7066
Log:
Don't dereference the span after a channel was closed.

Releasing the channel may trigger releasing a span in certain cases
(e.g. the last channel on a xpp (Astribank). This gives a niec panic on
closing of Asterisk under the right flow.

As the span was only dereferenced to access the owner field, we can save
it locally.

Issue has been present since r6794 .

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=7066&r1=7065&r2=7066
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Mon Aug 24 12:55:26 2009
@@ -2719,9 +2719,11 @@
 		spin_unlock_irqrestore(&chan->lock, flags);
 		close_channel(chan);
 		if (chan->span) {
+			struct module *owner = chan->span->owner;
+
 			if (chan->span->close)
 				res = chan->span->close(chan);
-			module_put(chan->span->owner);
+			module_put(owner);
 		}
 		/* The channel might be destroyed by low-level driver span->close() */
 		if (chans[unit])




More information about the svn-commits mailing list