[media] v4l: vb2-dma-contig: fix vb2_get_vma()
authorSri Krishna chowdary <schowdary@nvidia.com>
Tue, 12 Jan 2016 10:24:08 +0000 (15:24 +0530)
committerMatthew Pedro <mapedro@nvidia.com>
Thu, 28 Apr 2016 21:59:17 +0000 (14:59 -0700)
commit084df2dcb7607c947d061056a66eef55f308512c
tree4ba4ea403df5be4bcf370c1a4ba5b923940012c9
parent69291e6a08ddef8fc504d57f5e995fc336ca14c2
[media] v4l: vb2-dma-contig: fix vb2_get_vma()

nvmap expects that same VMA is opened and closed to disallow
memory leaks. So, nvmap panics if a previously non-existent vma
is being closed through it.

Hence modify the sequence in vb2_get_vma() to
open the vma_copy before returning it. This way nvmap sees that
the vma_copy exists in its list and will close the vma.

Bug 200164002

Change-Id: I45dfb8ca710375a0e70d9802ebdcc9fd4d0b4600
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/931997
(cherry picked from commit bf1d15d8a879a599f9801310cecbbb61ea60e931)
Reviewed-on: http://git-master/r/1133707
Tested-by: Bryan Wu <pengw@nvidia.com>
Reviewed-by: Bryan Wu <pengw@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
drivers/media/v4l2-core/videobuf2-memops.c