diff options
author | Shaun Ruffell <sruffell@digium.com> | 2008-07-07 19:36:57 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2008-07-07 19:36:57 +0000 |
commit | 4e4fe7ae266e7d8472e716901ad11e4af5f2f767 (patch) | |
tree | 03ebaea271c152cc2edabf92f17323c7f1a62dcb /drivers/dahdi/wctdm24xxp | |
parent | 3ae5aac6365ae379989a47c9fa3531e013da9112 (diff) |
wctdm_initialize expects the channels to already be allocated.
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4558 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctdm24xxp')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/base.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 1fa8868..bb229e2 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -3809,6 +3809,15 @@ retry: init_waitqueue_head(&wc->regq); + for (i = 0; i < wc->cards; i++) { + if (!(wc->chans[i] = kmalloc(sizeof(*wc->chans[i]), GFP_KERNEL))) { + free_wc(wc); + return -ENOMEM; + } + memset(wc->chans[i], 0, sizeof(*wc->chans[i])); + } + + if (wctdm_initialize(wc)) { voicebus_release(wc->vb); wc->vb = NULL; @@ -3843,14 +3852,6 @@ retry: /* Final initialization */ wctdm_post_initialize(wc); - for (i = 0; i < wc->cards; i++) { - if (!(wc->chans[i] = kmalloc(sizeof(*wc->chans[i]), GFP_KERNEL))) { - free_wc(wc); - return -ENOMEM; - } - memset(wc->chans[i], 0, sizeof(*wc->chans[i])); - } - /* We should be ready for DAHDI to come in now. */ if (dahdi_register(&wc->span, 0)) { printk("Unable to register span with DAHDI\n"); |