[Asterisk-cvs] zaptel wct4xxp.c,1.51.2.4,1.51.2.5

russell at lists.digium.com russell at lists.digium.com
Fri Apr 15 02:42:43 CDT 2005


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

Modified Files:
      Tag: v1-0
	wct4xxp.c 
Log Message:
fix mem leak when unloading/loading modules


Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.51.2.4
retrieving revision 1.51.2.5
diff -u -d -r1.51.2.4 -r1.51.2.5
--- wct4xxp.c	31 Mar 2005 22:57:19 -0000	1.51.2.4
+++ wct4xxp.c	15 Apr 2005 07:34:13 -0000	1.51.2.5
@@ -1662,6 +1662,7 @@
 static void __devexit t4_remove_one(struct pci_dev *pdev)
 {
 	struct t4 *wc = pci_get_drvdata(pdev);
+	int x;
 	if (wc) {
 		/* Stop hardware */
 		t4_hardware_stop(wc);
@@ -1701,6 +1702,11 @@
 #endif		
 		cards[wc->num] = NULL;
 		pci_set_drvdata(pdev, NULL);
+		for (x=0;x<4;x++) {
+			if (wc->chans[x])
+				kfree(wc->chans[x]);
+		}
+		kfree(wc);
 	}
 }
 




More information about the svn-commits mailing list