summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-06-29 14:02:35 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-06-29 14:02:35 +0000
commite4de227a9fcedf1a521bd8a885b8bcd8e180101d (patch)
treea996c39bd869821e614a8030582cf1779fae17bb
parentd843978bd66cc5b0b4a44ce2ff3c9ee78ccba5b1 (diff)
Fix crash in dahdi-base on channel close. From Zaptel r4348.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4477 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index ed59d26..f2b4cd7 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -2451,7 +2451,9 @@ static int dahdi_specchan_release(struct inode *node, struct file *file, int uni
close_channel(chans[unit]);
if (chans[unit]->span && chans[unit]->span->close)
res = chans[unit]->span->close(chans[unit]);
- clear_bit(DAHDI_FLAGBIT_OPEN, &chans[unit]->flags);
+ /* The channel might be destroyed by low-level driver span->close() */
+ if(chans[unit])
+ clear_bit(DAHDI_FLAGBIT_OPEN, &chans[unit]->flags);
} else
res = -ENXIO;
return res;