diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-08-05 21:05:11 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-08-05 21:05:11 +0000 |
commit | cc24c9f5f6dd0a77257018c1f612b09a5bb2ed32 (patch) | |
tree | 1698dffcb48cf7530da6975735f97de22cad06c5 | |
parent | 78fdae3b7d38341d69e71b3c1390fc1a913815a2 (diff) |
don't crash on disconnecting of AB
This is a regression from r8985 . The temporary 'module' was there because
the pointer 'chan' may become invalid after the close function.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9090 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index a54bbeb..a2d8d43 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -2771,9 +2771,11 @@ static int dahdi_specchan_release(struct file *file, int unit) spin_unlock_irqrestore(&chan->lock, flags); close_channel(chan); if (chan->span) { + struct module *owner = chan->span->ops->owner; + if (chan->span->ops->close) res = chan->span->ops->close(chan); - module_put(chan->span->ops->owner); + module_put(owner); } /* The channel might be destroyed by low-level driver span->close() */ if (chans[unit]) |