V4L/DVB (6263): Fix buffer release code
authorMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 6 Sep 2007 23:11:35 +0000 (20:11 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 03:02:54 +0000 (00:02 -0300)
Release code should happen before the cleaning of map variable.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/videobuf-vmalloc.c

index b2abfc9d9a8e68a34c1ce2a09b0665c8045536f6..fd059cde63f4d882c58ec6556a7da4cf8584683a 100644 (file)
@@ -84,9 +84,11 @@ videobuf_vm_close(struct vm_area_struct *vma)
 
                        if (mem->map != map)
                                continue;
+
+                       q->ops->buf_release(q,q->bufs[i]);
+
                        mem->map   = NULL;
                        q->bufs[i]->baddr = 0;
-                       q->ops->buf_release(q,q->bufs[i]);
                }
                mutex_unlock(&q->lock);
                kfree(map);