From: Yu Tang Date: Tue, 30 Aug 2011 05:31:54 +0000 (-0300) Subject: [media] media: vb2: fix userptr VMA release seq X-Git-Tag: next-20110927~67^2~4^2~102 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8607c42540d0aa61ab562506681d34c245b91fae;p=karo-tx-linux.git [media] media: vb2: fix userptr VMA release seq Align vb2 user pointer VMA release sequence with munmap. Do vm_ops->vm_close before release file. Signed-off-by: Yu Tang Signed-off-by: Marek Szyprowski Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/videobuf2-memops.c b/drivers/media/video/videobuf2-memops.c index 569eeb3dfd50..71a7a78c3fc0 100644 --- a/drivers/media/video/videobuf2-memops.c +++ b/drivers/media/video/videobuf2-memops.c @@ -68,12 +68,12 @@ void vb2_put_vma(struct vm_area_struct *vma) if (!vma) return; - if (vma->vm_file) - fput(vma->vm_file); - if (vma->vm_ops && vma->vm_ops->close) vma->vm_ops->close(vma); + if (vma->vm_file) + fput(vma->vm_file); + kfree(vma); } EXPORT_SYMBOL_GPL(vb2_put_vma);