[Asterisk-cvs] zaptel zaptel.c,1.50,1.51

markster at lists.digium.com markster at lists.digium.com
Tue Dec 9 14:44:45 CST 2003


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv19943

Modified Files:
	zaptel.c 
Log Message:
Don't open /dev/zap/pseudo if there are no spans


Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- zaptel.c	27 Nov 2003 06:48:54 -0000	1.50
+++ zaptel.c	9 Dec 2003 20:36:13 -0000	1.51
@@ -2089,7 +2089,11 @@
 
 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));




More information about the svn-commits mailing list