From: Sylwester Nawrocki Date: Fri, 11 Feb 2011 15:33:06 +0000 (-0300) Subject: [media] s5p-fimc: Prevent oops when i2c adapter is not available X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a0f8caefaf3295721ef00415c7d63ec10af253ab;p=linux-beck.git [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 --- diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index 6b6f72e4066c..423931c0cfe5 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;