summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-12-09 20:36:13 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-12-09 20:36:13 +0000
commit85000fd2bd42efd318888e5961cc4a9d2169f7e8 (patch)
treed5b21d5255a43e42936f6fee83a2adb22d364a91 /zaptel.c
parenta80fc27c072a5f9aaf7ff4194f78ebe1118ad9dc (diff)
Don't open /dev/zap/pseudo if there are no spans
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@289 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/zaptel.c b/zaptel.c
index f1545b6..fe4cb6f 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -2089,7 +2089,11 @@ static int zt_specchan_release(struct inode *node, struct file *file, int unit)
static struct zt_chan *zt_alloc_pseudo(void)
{
- struct zt_chan *pseudo = kmalloc(sizeof(struct zt_chan), GFP_KERNEL);
+ struct zt_chan *pseudo;
+ /* Don't allow /dev/zap/pseudo to open if there are no spans */
+ if (maxspans < 1)
+ return NULL;
+ pseudo = kmalloc(sizeof(struct zt_chan), GFP_KERNEL);
if (!pseudo)
return NULL;
memset(pseudo, 0, sizeof(struct zt_chan));