diff options
author | Rakesh Movva | 2014-07-31 15:13:20 -0500 |
---|---|---|
committer | Gerrit Code Review | 2014-08-05 16:19:45 -0500 |
commit | 475700abacd2419a9783183ff2f23c8b6c911614 (patch) | |
tree | 750822bdffb6e3c0a8420dd9688ac9165297bde1 | |
parent | 89a59e66c02d1441fb8f51141e18c21c300731ce (diff) | |
download | kernel-audio-475700abacd2419a9783183ff2f23c8b6c911614.tar.gz kernel-audio-475700abacd2419a9783183ff2f23c8b6c911614.tar.xz kernel-audio-475700abacd2419a9783183ff2f23c8b6c911614.zip |
ti-ec: Fix up for vip_open() crash when no camera connected.
Initially there was no check before calling the vip_open in the
earlycam driver module. This fix in main_fn() thread function
checks whether there is any valid camera device connected before
performing any operations on vip.
Change-Id: I54a90a09785d8a6b7f06660e6a3e75777fa587d9
Signed-off-by: Rakesh Movva <r-movva@ti.com>
-rw-r--r-- | drivers/misc/ti-ec/earlycam.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/ti-ec/earlycam.c b/drivers/misc/ti-ec/earlycam.c index 3cf82ef55c9e..f5f11520ac32 100644 --- a/drivers/misc/ti-ec/earlycam.c +++ b/drivers/misc/ti-ec/earlycam.c | |||
@@ -359,6 +359,12 @@ int main_fn(void *arg) | |||
359 | dtr.d_inode = ∈ | 359 | dtr.d_inode = ∈ |
360 | fp.f_path.dentry = &dtr; | 360 | fp.f_path.dentry = &dtr; |
361 | 361 | ||
362 | ret = video_devdata(&fp); | ||
363 | if (ret == NULL) { | ||
364 | pr_err("Camera device not connected\n"); | ||
365 | return ret; | ||
366 | } | ||
367 | |||
362 | ret = display_init(); | 368 | ret = display_init(); |
363 | if (ret) { | 369 | if (ret) { |
364 | pr_err("display_init failed with error %d", ret); | 370 | pr_err("display_init failed with error %d", ret); |