media: vb2: Fix videobuf2 to map correct area
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 6 Feb 2018 08:02:23 +0000 (03:02 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 26 Feb 2018 13:06:31 +0000 (08:06 -0500)
commitd13a0139d7874a0577b5955d6eed895517d23b72
treebea9ec23c8fef71f4118c2b6fca465c66259ef1d
parent14351d44830ec00b8c66b44c8c866944da678c33
media: vb2: Fix videobuf2 to map correct area

Fixes vb2_vmalloc_get_userptr() to ioremap correct area.
Since the current code does ioremap the page address, if the offset > 0,
it does not do ioremap the last page and results in kernel panic.

This fixes to pass the size + offset to ioremap so that ioremap
can map correct area. Also, this uses __pfn_to_phys() to get the physical
address of given PFN.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Reported-by: Takao Orito <orito.takao@socionext.com>
Reported-by: Fumihiro ATSUMI <atsumi@infinitegra.co.jp>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/common/videobuf2/videobuf2-vmalloc.c