video: tegra: nvmap: fix input check in mmap ioctl
authorTuomas Tynkkynen <ttynkkynen@nvidia.com>
Tue, 31 Jul 2012 14:49:49 +0000 (17:49 +0300)
committerSimone Willett <swillett@nvidia.com>
Thu, 16 Aug 2012 20:42:43 +0000 (13:42 -0700)
commit2f4ab5b6a19c1380b0985f914c173af09b802dcf
treea177d4759153cf82ff5edb6c0641e54e6a01c89d
parenta6e2dc5aacc56bdbc771cdf0e9e75924c1ea6650
video: tegra: nvmap: fix input check in mmap ioctl

nvmap_map_into_caller_ptr takes a memory handle from usermode
and adds a memory mapping for the handle. However, the handle
is not checked for being allocated. An unallocated handle
would cause a kernel panic later on from a NULL dereference.

Change-Id: I73987b097a0c843b913660445e8bd1b4755dac61
Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Reviewed-on: http://git-master/r/119689
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
drivers/video/tegra/nvmap/nvmap_ioctl.c