From a0f8caefaf3295721ef00415c7d63ec10af253ab Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Fri, 11 Feb 2011 12:33:06 -0300 Subject: [PATCH] [media] s5p-fimc: Prevent oops when i2c adapter is not available Prevent invalid pointer dereference on error path. Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/s5p-fimc/fimc-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index 6b6f72e..423931c 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; -- 2.7.4