media: exynos4-is: Add missed check for pinctrl_lookup_state()
authorChuhong Yuan <hslester96@gmail.com>
Thu, 28 May 2020 06:41:47 +0000 (08:41 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 4 Jul 2020 10:44:12 +0000 (12:44 +0200)
fimc_md_get_pinctrl() misses a check for pinctrl_lookup_state().
Add the missed check to fix it.

Fixes: 4163851f7b99 ("[media] s5p-fimc: Use pinctrl API for camera ports configuration]")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/exynos4-is/media-dev.c

index 96e336b..16dd660 100644 (file)
@@ -1270,6 +1270,9 @@ static int fimc_md_get_pinctrl(struct fimc_md *fmd)
 
        pctl->state_idle = pinctrl_lookup_state(pctl->pinctrl,
                                        PINCTRL_STATE_IDLE);
+       if (IS_ERR(pctl->state_idle))
+               return PTR_ERR(pctl->state_idle);
+
        return 0;
 }