]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
media: vb2: Fix videobuf2 to map correct area
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 6 Feb 2018 08:02:23 +0000 (03:02 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:29:42 +0000 (12:29 +0200)
commitfa2aac02c5782acdbfb4313680dc431fd0523e3b
treef17878e52fec1af88f9289442366153701d9f712
parent7fb6a870bbe01751ee57501e7e8b2f45cfbc4744
media: vb2: Fix videobuf2 to map correct area

BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit d13a0139d7874a0577b5955d6eed895517d23b72 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/media/v4l2-core/videobuf2-vmalloc.c