[dahdi-commits] sruffell: linux/trunk r10587 - /linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Thu Mar 22 13:31:12 CDT 2012


Author: sruffell
Date: Thu Mar 22 13:31:08 2012
New Revision: 10587

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10587
Log:
dahdi_dynamic_eth: Prevent crash is packet arrives before span is fully configured.

It was possible after a dynamic ethernet span was created for a packet to come
in before the dahdi_span was fully initialized. The result would be a NULL
pointer dereference. Now just discard any packets that might come in during
this time window.

Internal-Issue-ID: DAHLIN-280
Reported-by: Pavel Selivanov
Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c

Modified: linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c?view=diff&rev=10587&r1=10586&r2=10587
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c (original)
+++ linux/trunk/drivers/dahdi/dahdi_dynamic_eth.c Thu Mar 22 13:31:08 2012
@@ -71,6 +71,8 @@
 	if (z)
 		span = z->span;
 	spin_unlock_irqrestore(&zlock, flags);
+	if (!span || !test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags))
+		return NULL;
 	return span;
 }
 




More information about the dahdi-commits mailing list