diff options
author | Shaun Ruffell <sruffell@digium.com> | 2012-03-22 18:36:01 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2012-03-22 18:36:01 +0000 |
commit | 9d98bcf1dbc1adbe381c5b4e07e1c4e14be2a971 (patch) | |
tree | 2bb9bb9d0f6eb71a7704c8f385543de362c88261 | |
parent | d831be04b9650918b9ad5d1bb0808f89420f5b2b (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>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10587
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10591 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 0fc660f..0db3736 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; } |