diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-12-13 14:57:12 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-12-13 14:57:12 +0000 |
commit | 4e7b1fd9ff0ac0e89b113fc6c966455f7928ac55 (patch) | |
tree | 4fe2988b59aec60f2b7feeb2b3a24c04e33f1747 /drivers/dahdi | |
parent | 7940e806d993a5601b610b4ab089a6e13ba39e60 (diff) |
dahdi: Do not dereference chan->span for pseudo channels.
Fixes a regression introduced in r9510 which saves a pointer to the ops
member of a channel's span before checking if the channel is a pseudo.
Psuedo channels do not have spans.
(issue #18463)
(issue #18422)
Reported by: alecdavis
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9530 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 698e37d..a29a63f 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -2739,7 +2739,6 @@ static int dahdi_specchan_open(struct file *file) res = -EBUSY; else if (!test_and_set_bit(DAHDI_FLAGBIT_OPEN, &chan->flags)) { unsigned long flags; - const struct dahdi_span_ops *ops; res = initialize_channel(chan); if (res) { /* Reallocbufs must have failed */ @@ -2747,10 +2746,11 @@ static int dahdi_specchan_open(struct file *file) return res; } spin_lock_irqsave(&chan->lock, flags); - ops = chan->span->ops; if (is_pseudo_chan(chan)) chan->flags |= DAHDI_FLAG_AUDIO; if (chan->span) { + const struct dahdi_span_ops *const ops = + chan->span->ops; if (!try_module_get(ops->owner)) { res = -ENXIO; } else if (ops->open) { |