summaryrefslogtreecommitdiff
path: root/wct4xxp
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-21 15:57:20 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-21 15:57:20 +0000
commit34df77129357dc4d9eb11c93464bb02a6d5a3bb8 (patch)
tree51eaaa11ff7941bf27c397e8f5b70dc52ed40830 /wct4xxp
parentf175c93afb06e29802131bccafcc42cc4f657fef (diff)
Make sure we do the check for memory allocation failure.
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2199 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp')
-rw-r--r--wct4xxp/vpm450m.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/wct4xxp/vpm450m.c b/wct4xxp/vpm450m.c
index 0ba2462..a30dacf 100644
--- a/wct4xxp/vpm450m.c
+++ b/wct4xxp/vpm450m.c
@@ -210,6 +210,10 @@ static void vpm450m_setecmode(struct vpm450m *vpm450m, int channel, int mode)
if (vpm450m->ecmode[channel] == mode)
return;
modify = kmalloc(sizeof(tOCT6100_CHANNEL_MODIFY), GFP_KERNEL);
+ if (!modify) {
+ printk("wct4xxp: Unable to allocate memory for setec!\n");
+ return;
+ }
Oct6100ChannelModifyDef(modify);
modify->ulEchoOperationMode = mode;
modify->ulChannelHndl = vpm450m->aulEchoChanHndl[channel];
@@ -231,6 +235,10 @@ void vpm450m_setdtmf(struct vpm450m *vpm450m, int channel, int detect, int mute)
UINT32 ulResult;
modify = kmalloc(sizeof(tOCT6100_CHANNEL_MODIFY), GFP_KERNEL);
+ if (!modify) {
+ printk("wct4xxp: Unable to allocate memory for setdtmf!\n");
+ return;
+ }
Oct6100ChannelModifyDef(modify);
modify->ulChannelHndl = vpm450m->aulEchoChanHndl[channel];
if (mute) {