[media] s5p-fimc: Prevent oops when i2c adapter is not available
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Fri, 11 Feb 2011 15:33:06 +0000 (12:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 22 Mar 2011 07:54:14 +0000 (04:54 -0300)
Prevent invalid pointer dereference on error path.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/s5p-fimc/fimc-capture.c

index 6b6f72e4066c503cd214a8913676a20d63888576..423931c0cfe5902fa9337b95476db82d72fc0c15 100644 (file)
@@ -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;