video: host: tegra_vi: add check tegra_vi for NULL
authorBryan Wu <pengw@nvidia.com>
Thu, 9 Jan 2014 19:30:42 +0000 (11:30 -0800)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Mon, 13 Jan 2014 14:45:47 +0000 (06:45 -0800)
commita03f52dfc50ea43789752d5e8524c0da15780caa
treee44f3e8cc49b9fb82d4970562dee229f4427759d
parentb64b6ec5b893185b9fe1c834d42d06eb0cc63968
video: host: tegra_vi: add check tegra_vi for NULL

commit 2d767dccc494f6c503ceac68efa2fe474c5f8d74 will cause kernel oops
when removing tegra_camera module from kernel.

The root cause is tegra_camera V4L2 driver doesn't use
pdata->private_data, which is NULL in this case. So it will cause NULL
pointer access when calling functions in tegra_vi.c.

Add check pointer of tegra_vi for NULL to fix this issue.

Bug 1437413

Change-Id: I4b5189a711e1477509f5f3dbefa98c685a8b94df
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/353891
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/vi/tegra_vi.c