diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-12-09 20:36:13 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-12-09 20:36:13 +0000 |
commit | 85000fd2bd42efd318888e5961cc4a9d2169f7e8 (patch) | |
tree | d5b21d5255a43e42936f6fee83a2adb22d364a91 /zaptel.c | |
parent | a80fc27c072a5f9aaf7ff4194f78ebe1118ad9dc (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-x | zaptel.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)); |