From 27899f256c1b2d5b6396bce278a7d3080e23e244 Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Wed, 20 Oct 2010 16:20:30 +0000 Subject: [PATCH] dahdi-base: Fixed null pointer dereference in dahdi_check_conf Fixes regression from rev 9366 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9449 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/dahdi-base.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 5e654f6..a595bb0 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -951,8 +951,11 @@ static void dahdi_check_conf(int x) for (y = 0; y < maxchans; y++) { struct dahdi_chan *const chan = chan_from_num(y); - const int confmode = chan->confmode & DAHDI_CONF_MODE_MASK; - if (chan && (chan->confna == x) && + int confmode; + if (!chan) + continue; + confmode = chan->confmode & DAHDI_CONF_MODE_MASK; + if ((chan->confna == x) && (confmode == DAHDI_CONF_CONF || confmode == DAHDI_CONF_CONFANN || confmode == DAHDI_CONF_CONFMON ||