summaryrefslogtreecommitdiff
path: root/include/media/drv-intf
diff options
context:
space:
mode:
authorSimon Shields <simon@lineageos.org>2017-11-27 08:12:41 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 15:12:12 -0500
commit3090a1915e9865d23f2aa76cc01e5b5f9cb6d7e3 (patch)
treefea120340763d6c187cb1859237554db15859117 /include/media/drv-intf
parent2d41a0c9ae51ac363d107f2510022106e7234b33 (diff)
media: exynos4-is: Check pipe is valid before calling subdev
If the subdev is not yet present (probably because the subdev module has not yet been loaded), the pipe will be NULL. Make sure that this is not the case before attempting to call the op. Signed-off-by: Simon Shields <simon@lineageos.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media/drv-intf')
-rw-r--r--include/media/drv-intf/exynos-fimc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/media/drv-intf/exynos-fimc.h b/include/media/drv-intf/exynos-fimc.h
index 69bcd2a07d5c..f9c64338841f 100644
--- a/include/media/drv-intf/exynos-fimc.h
+++ b/include/media/drv-intf/exynos-fimc.h
@@ -155,7 +155,8 @@ static inline struct exynos_video_entity *vdev_to_exynos_video_entity(
}
#define fimc_pipeline_call(ent, op, args...) \
- (!(ent) ? -ENOENT : (((ent)->pipe->ops && (ent)->pipe->ops->op) ? \
+ ((!(ent) || !(ent)->pipe) ? -ENOENT : \
+ (((ent)->pipe->ops && (ent)->pipe->ops->op) ? \
(ent)->pipe->ops->op(((ent)->pipe), ##args) : -ENOIOCTLCMD)) \
#endif /* S5P_FIMC_H_ */