mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: omap3isp: handle NULL return of omap3isp_video_format_info() in ccdc_is_shiftable().
@ 2017-06-26 17:54 H. Nikolaus Schaller
  2017-06-26 20:12 ` Sakari Ailus
  0 siblings, 1 reply; 4+ messages in thread
From: H. Nikolaus Schaller @ 2017-06-26 17:54 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab, s-anna
  Cc: linux-media, linux-kernel, letux-kernel, H. Nikolaus Schaller

If a camera module driver specifies a format that is not
supported by omap3isp this ends in a NULL pointer
dereference instead of a simple fail.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/media/platform/omap3isp/ispccdc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c
index 2fb755f20a6b..dcf16ee7c612 100644
--- a/drivers/media/platform/omap3isp/ispccdc.c
+++ b/drivers/media/platform/omap3isp/ispccdc.c
@@ -2397,6 +2397,9 @@ static bool ccdc_is_shiftable(u32 in, u32 out, unsigned int additional_shift)
 	in_info = omap3isp_video_format_info(in);
 	out_info = omap3isp_video_format_info(out);
 
+	if (!in_info || !out_info)
+		return false;
+
 	if ((in_info->flavor == 0) || (out_info->flavor == 0))
 		return false;
 
-- 
2.12.2

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-27  5:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 17:54 [PATCH] media: omap3isp: handle NULL return of omap3isp_video_format_info() in ccdc_is_shiftable() H. Nikolaus Schaller
2017-06-26 20:12 ` Sakari Ailus
2017-06-27  5:46   ` H. Nikolaus Schaller
2017-06-27  5:57     ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®