[zaptel-commits] mattf: trunk r2552 - /trunk/wct4xxp/vpm450m.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Jun 1 10:09:47 MST 2007


Author: mattf
Date: Fri Jun  1 12:09:47 2007
New Revision: 2552

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2552
Log:
Merged revisions 2551 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.4

................
r2551 | mattf | 2007-06-01 12:06:29 -0500 (Fri, 01 Jun 2007) | 10 lines

Merged revisions 2550 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r2550 | mattf | 2007-06-01 11:56:09 -0500 (Fri, 01 Jun 2007) | 2 lines

Fix for stack overflow on FC6 and VPM450M.

........

................

Modified:
    trunk/wct4xxp/vpm450m.c

Modified: trunk/wct4xxp/vpm450m.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/vpm450m.c?view=diff&rev=2552&r1=2551&r2=2552
==============================================================================
--- trunk/wct4xxp/vpm450m.c (original)
+++ trunk/wct4xxp/vpm450m.c Fri Jun  1 12:09:47 2007
@@ -407,6 +407,7 @@
 	UINT32 ulResult;
 	struct vpm450m *vpm450m;
 	int x,y,law;
+	unsigned long flags;
 	
 	if (!(vpm450m = kmalloc(sizeof(struct vpm450m), GFP_KERNEL)))
 		return NULL;
@@ -476,9 +477,16 @@
 		return NULL;
 	}
 
+	/* I don't know what to curse more in this comment, the problems caused by
+	 * the 4K kernel stack limit change or the octasic API for being so darn
+	 * stack unfriendly.  Stupid, stupid, stupid.  So we disable IRQs so we
+	 * don't run the risk of overflowing the stack while we initialize the
+	 * octasic. */
+	local_irq_save(flags);
 	ulResult = Oct6100ChipOpen(vpm450m->pApiInstance, ChipOpen);
 	if (ulResult != cOCT6100_ERR_OK) {
 		printk("Failed to open chip, code %08x!\n", ulResult);
+		local_irq_restore(flags);
 		kfree(vpm450m);
 		kfree(ChipOpen);
 		kfree(ChannelOpen);
@@ -533,6 +541,7 @@
 		}
 	}
 
+	local_irq_restore(flags);
 	kfree(ChipOpen);
 	kfree(ChannelOpen);
 	return vpm450m;



More information about the zaptel-commits mailing list