From: Sakari Ailus <sakari.ailus@iki.fi>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
s-anna@ti.com, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org
Subject: Re: [PATCH] media: omap3isp: handle NULL return of omap3isp_video_format_info() in ccdc_is_shiftable().
Date: Mon, 26 Jun 2017 23:12:53 +0300 [thread overview]
Message-ID: <20170626201253.GU12407@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <a601fdb6d224f2e4f1a3c1249ebf8438f4b8b5ce.1498499658.git.hns@goldelico.com>
Hi Nikolaus,
On Mon, Jun 26, 2017 at 07:54:19PM +0200, H. Nikolaus Schaller wrote:
> 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.
Has this happened in practice? If it does, it is probably a driver bug ---
the formats on its pads should be recognised by the driver.
WARN_ON() around the condition would be good to avoid silently ignoring such
issues.
I wonder what Laurent thinks.
>
> 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;
>
--
Regards,
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
next prev parent reply other threads:[~2017-06-26 20:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-26 17:54 H. Nikolaus Schaller
2017-06-26 20:12 ` Sakari Ailus [this message]
2017-06-27 5:46 ` H. Nikolaus Schaller
2017-06-27 5:57 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170626201253.GU12407@valkosipuli.retiisi.org.uk \
--to=sakari.ailus@iki.fi \
--cc=hns@goldelico.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=letux-kernel@openphoenux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=s-anna@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®