diff options
author | Shaun Ruffell <sruffell@digium.com> | 2012-03-22 18:31:08 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2012-03-22 18:31:08 +0000 |
commit | f56471eb8c6b3cbe85bc411870956e8fa6a2090f (patch) | |
tree | 37b9b6e078e830f243fc90e1de66da60d2bfb52c | |
parent | 02ee489e79c4b0c1f5f40fa722d0f94feb950505 (diff) |
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@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10587 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/dahdi_dynamic_eth.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dahdi/dahdi_dynamic_eth.c b/drivers/dahdi/dahdi_dynamic_eth.c index f68a4ea..ecf46ea 100644 --- a/drivers/dahdi/dahdi_dynamic_eth.c +++ b/drivers/dahdi/dahdi_dynamic_eth.c @@ -71,6 +71,8 @@ static struct dahdi_span *ztdeth_getspan(unsigned char *addr, unsigned short sub if (z) span = z->span; spin_unlock_irqrestore(&zlock, flags); + if (!span || !test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags)) + return NULL; return span; } |