Prevent invalid pointer dereference on error path.

Signed-off-by: Sylwester Nawrocki <s.nawro...@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.p...@samsung.com>
---
 drivers/media/video/s5p-fimc/fimc-capture.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c 
b/drivers/media/video/s5p-fimc/fimc-capture.c
index 10d6426..2d8002c 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -98,7 +98,7 @@ static int fimc_subdev_attach(struct fimc_dev *fimc, int 
index)
                        continue;
 
                sd = fimc_subdev_register(fimc, isp_info);
-               if (sd) {
+               if (!IS_ERR_OR_NULL(sd)) {
                        vid_cap->sd = sd;
                        vid_cap->input_index = i;
 
-- 
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to