[media] s5p-fimc: Fix fimc-lite entities deregistration
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Fri, 11 Jan 2013 10:06:28 +0000 (07:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 6 Feb 2013 11:42:19 +0000 (09:42 -0200)
Clear the proper array when deregistering FIMC-LITE devices. Now
fimc[] array is erroneously accessed instead of fimc_lite[] and
fimc_md_unregister_entities() function call can result in an oops
from NULL pointer dereference, since fmd->fimc[] is cleared earlier.
This might happen in normal conditions when the driver's probing
is deferred and then retried.

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/platform/s5p-fimc/fimc-mdevice.c

index f49f6f17a3f78084f529c25c8651eed3c6cce1c1..a17fcb2d5d413ca66ed9a16a31a34045a83a0d6b 100644 (file)
@@ -472,7 +472,7 @@ static void fimc_md_unregister_entities(struct fimc_md *fmd)
                if (fmd->fimc_lite[i] == NULL)
                        continue;
                v4l2_device_unregister_subdev(&fmd->fimc_lite[i]->subdev);
-               fmd->fimc[i]->pipeline_ops = NULL;
+               fmd->fimc_lite[i]->pipeline_ops = NULL;
                fmd->fimc_lite[i] = NULL;
        }
        for (i = 0; i < CSIS_MAX_ENTITIES; i++) {