[svn-commits] mogorman: trunk r1744 - /trunk/zttranscode.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Dec 19 15:23:03 MST 2006


Author: mogorman
Date: Tue Dec 19 16:23:02 2006
New Revision: 1744

URL: http://svn.digium.com/view/zaptel?view=rev&rev=1744
Log:
only clear pages that have been used, the real cause for problems.

Modified:
    trunk/zttranscode.c

Modified: trunk/zttranscode.c
URL: http://svn.digium.com/view/zaptel/trunk/zttranscode.c?view=diff&rev=1744&r1=1743&r2=1744
==============================================================================
--- trunk/zttranscode.c (original)
+++ trunk/zttranscode.c Tue Dec 19 16:23:02 2006
@@ -207,14 +207,16 @@
 	if (!ztc)
 		return;
 
-	for (page = virt_to_page(zth);
-	     page < virt_to_page((unsigned long) zth + sizeof(*zth));
-	     page++)
-		ClearPageReserved(page);
-
 	ztc->flags &= ~(ZT_TC_FLAG_BUSY);
-	if (ztc->tch)
+
+	if (ztc->tch) {
+		for (page = virt_to_page(zth);
+		     page < virt_to_page((unsigned long) zth + sizeof(*zth));
+		     page++)
+			ClearPageReserved(page);
 		kfree(ztc->tch);
+	}
+
 	ztc->tch = NULL;
 	/* Actually reset the transcoder channel */
 	if (ztc->flags & ZT_TC_FLAG_TRANSIENT)



More information about the svn-commits mailing list