summaryrefslogtreecommitdiff
path: root/zttranscode.c
diff options
context:
space:
mode:
Diffstat (limited to 'zttranscode.c')
-rw-r--r--zttranscode.c14
1 files changed, 8 insertions, 6 deletions
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)