From e2cd32b13fe66f88eb7d9adc79d1c1f111b4ffa4 Mon Sep 17 00:00:00 2001 From: mogorman Date: Tue, 19 Dec 2006 22:23:02 +0000 Subject: only clear pages that have been used, the real cause for problems. git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1744 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zttranscode.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'zttranscode.c') diff --git a/zttranscode.c b/zttranscode.c index 896f380..862c503 100644 --- a/zttranscode.c +++ b/zttranscode.c @@ -207,14 +207,16 @@ static void ztc_release(struct zt_transcoder_channel *ztc) 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) -- cgit v1.2.3