diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-11-15 15:15:48 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2012-11-15 15:15:48 +0000 |
commit | 8de25ff60f872a18492b9c3b7eb1a8e66ce08e31 (patch) | |
tree | c14699e014d739329631e57974e351676389d2d6 | |
parent | 340e2fba2cf52b3e4e6c5b66367f26567ec4bf0c (diff) |
xpp: pre/post_unregister: not for the ECsvn_2.6
Don't run the pre- and post-unregister hooks on a non-phone XPD
(practically: the echo canceller). This fixes a panic with manual
'dahdi_registertion off' as it is now called for the whole device
(regression of 2.6.x).
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
Origin: http://svnview.digium.com/svn/dahdi?view=rev&rev=10735
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/branches/2.6@10736 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | drivers/dahdi/xpp/xpp_dahdi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dahdi/xpp/xpp_dahdi.c b/drivers/dahdi/xpp/xpp_dahdi.c index b9fa49a..b2f7008 100644 --- a/drivers/dahdi/xpp/xpp_dahdi.c +++ b/drivers/dahdi/xpp/xpp_dahdi.c @@ -1083,7 +1083,7 @@ int xpd_dahdi_postregister(xpd_t *xpd) */ void xpd_dahdi_preunregister(xpd_t *xpd) { - if (!xpd) + if (!xpd || !IS_PHONEDEV(xpd)) return; XPD_DBG(DEVICES, xpd, "\n"); update_xpd_status(xpd, DAHDI_ALARM_NOTOPEN); @@ -1103,7 +1103,7 @@ void xpd_dahdi_preunregister(xpd_t *xpd) void xpd_dahdi_postunregister(xpd_t *xpd) { - if (!xpd) + if (!xpd || !IS_PHONEDEV(xpd)) return; atomic_dec(&PHONEDEV(xpd).dahdi_registered); atomic_dec(&num_registered_spans); |