summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi-base.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2008-09-18 21:21:11 +0000
committerShaun Ruffell <sruffell@digium.com>2008-09-18 21:21:11 +0000
commit36c6135a96faf330bb490ab957ab95dc627477d8 (patch)
treec10747f6aaeb1294c4d41c62e914ab0c1fc39023 /drivers/dahdi/dahdi-base.c
parentd3b46227b5b75c4eca5c178f8fe47efa3cbff85f (diff)
close_channel is called with a spin_lock held, which means that GFP_KERNEL can
not be used for the memory allocations down that call path. Have allocations in this call path check if they are in atomic context and use the appropriate flags. Issue: DAHDI-195 git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4956 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi-base.c')
-rw-r--r--drivers/dahdi/dahdi-base.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index be41260..48361e2 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -48,6 +48,7 @@
#include <linux/kmod.h>
#include <linux/moduleparam.h>
#include <linux/list.h>
+#include <linux/interrupt.h>
#ifdef CONFIG_DAHDI_NET
#include <linux/netdevice.h>
@@ -867,7 +868,7 @@ static int dahdi_reallocbufs(struct dahdi_chan *ss, int j, int numbufs)
/* We need to allocate our buffers now */
if (j) {
- if(!(newbuf = kcalloc(j * 2, numbufs, GFP_KERNEL)))
+ if(!(newbuf = kcalloc(j * 2, numbufs, (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL)))
return -ENOMEM;
} else
newbuf = NULL;