[zaptel-commits] tzafrir: branch 1.4 r4348 - /branches/1.4/kernel/zaptel-base.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Jun 5 15:06:34 CDT 2008


Author: tzafrir
Date: Thu Jun  5 15:06:34 2008
New Revision: 4348

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4348
Log:
Fixes a potential panic in Xorcom Astribanks devices if disconnected
when a userspace program still holds a channel open. Regression from
changeset 4250 .

Modified:
    branches/1.4/kernel/zaptel-base.c

Modified: branches/1.4/kernel/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/kernel/zaptel-base.c?view=diff&rev=4348&r1=4347&r2=4348
==============================================================================
--- branches/1.4/kernel/zaptel-base.c (original)
+++ branches/1.4/kernel/zaptel-base.c Thu Jun  5 15:06:34 2008
@@ -2515,7 +2515,10 @@
 		close_channel(chans[unit]);
 		if (chans[unit]->span && chans[unit]->span->close)
 			res = chans[unit]->span->close(chans[unit]);
-		clear_bit(ZT_FLAGBIT_OPEN, &chans[unit]->flags);
+
+		/* The channel might be destroyed on close: */
+		if (chans[unit])
+			clear_bit(ZT_FLAGBIT_OPEN, &chans[unit]->flags);
 	} else
 		res = -ENXIO;
 #ifndef LINUX26




More information about the zaptel-commits mailing list