From: Mauro Carvalho Chehab Date: Thu, 6 Sep 2007 23:11:35 +0000 (-0300) Subject: V4L/DVB (6263): Fix buffer release code X-Git-Tag: v2.6.24-rc1~1463^2~41 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=123f8ef64e3996e06a930756b6b2cdede4b18da0;p=linux-2.6 V4L/DVB (6263): Fix buffer release code Release code should happen before the cleaning of map variable. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/videobuf-vmalloc.c b/drivers/media/video/videobuf-vmalloc.c index b2abfc9d9a..fd059cde63 100644 --- a/drivers/media/video/videobuf-vmalloc.c +++ b/drivers/media/video/videobuf-vmalloc.c @@ -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);