aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc/fimc-mdevice.c
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2012-04-30 12:10:58 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-20 09:14:11 -0300
commit41df5bf088a10e54c0613ec4d7350b74d5ab8252 (patch)
treec2782e2532227597db4c8c765b861270743ae705 /drivers/media/video/s5p-fimc/fimc-mdevice.c
parent[media] s5p-mfc: Use devm_* functions in s5p_mfc.c file (diff)
downloadlinux-dev-41df5bf088a10e54c0613ec4d7350b74d5ab8252.tar.xz
linux-dev-41df5bf088a10e54c0613ec4d7350b74d5ab8252.zip
[media] s5p-fimc: Avoid crash with null platform_data
In commit "s5p-fimc: Handle sub-device interdependencies using deferred.." there was a check added for pdata->num_clients without first checking pdata against NULL. This causes a crash when platform_data is not set, which is a valid use case. Fix this regression by skipping the MIPI-CSIS subdev registration also when pdata is null. Reported-by: HeungJun Kim <riverful.kim@samsung.com> 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>
Diffstat (limited to 'drivers/media/video/s5p-fimc/fimc-mdevice.c')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-mdevice.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-mdevice.c b/drivers/media/video/s5p-fimc/fimc-mdevice.c
index 75296a625a9d..f97ac02b8677 100644
--- a/drivers/media/video/s5p-fimc/fimc-mdevice.c
+++ b/drivers/media/video/s5p-fimc/fimc-mdevice.c
@@ -371,6 +371,8 @@ static int fimc_md_register_platform_entities(struct fimc_md *fmd)
* Check if there is any sensor on the MIPI-CSI2 bus and
* if not skip the s5p-csis module loading.
*/
+ if (pdata == NULL)
+ return 0;
for (i = 0; i < pdata->num_clients; i++) {
if (pdata->isp_info[i].bus_type == FIMC_MIPI_CSI2) {
ret = 1;