From: Dan Carpenter <dan.carpenter@oracle.com>
To: s.nawrocki@samsung.com
Cc: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Subject: [bug report] [media] exynos4-is: Add the FIMC-IS ISP capture DMA driver
Date: Thu, 3 May 2018 14:43:01 +0300 [thread overview]
Message-ID: <20180503114301.GA7576@mwanda> (raw)
[ This code is five years old now. It's so weird to me that the warning
is showing up in my new warnings pile. Perhaps this wasn't included
in my allmodconfig before? - dan ]
Hello Sylwester Nawrocki,
The patch 34947b8aebe3: "[media] exynos4-is: Add the FIMC-IS ISP
capture DMA driver" from Dec 20, 2013, leads to the following static
checker warning:
drivers/media/platform/exynos4-is/fimc-isp-video.c:408 isp_video_try_fmt_mplane()
error: NULL dereference inside function '__isp_video_try_fmt(isp, &f->fmt.pix_mp, (0))()'.
drivers/media/platform/exynos4-is/fimc-isp-video.c
383 static void __isp_video_try_fmt(struct fimc_isp *isp,
384 struct v4l2_pix_format_mplane *pixm,
385 const struct fimc_fmt **fmt)
386 {
387 *fmt = fimc_isp_find_format(&pixm->pixelformat, NULL, 2);
^^^^
Unchecked dereference. We're not allowed to pass a NULL "fmt".
388
389 pixm->colorspace = V4L2_COLORSPACE_SRGB;
390 pixm->field = V4L2_FIELD_NONE;
391 pixm->num_planes = (*fmt)->memplanes;
392 pixm->pixelformat = (*fmt)->fourcc;
393 /*
394 * TODO: double check with the docmentation these width/height
395 * constraints are correct.
396 */
397 v4l_bound_align_image(&pixm->width, FIMC_ISP_SOURCE_WIDTH_MIN,
398 FIMC_ISP_SOURCE_WIDTH_MAX, 3,
399 &pixm->height, FIMC_ISP_SOURCE_HEIGHT_MIN,
400 FIMC_ISP_SOURCE_HEIGHT_MAX, 0, 0);
401 }
402
403 static int isp_video_try_fmt_mplane(struct file *file, void *fh,
404 struct v4l2_format *f)
405 {
406 struct fimc_isp *isp = video_drvdata(file);
407
408 __isp_video_try_fmt(isp, &f->fmt.pix_mp, NULL);
^^^^
And yet here we are.
409 return 0;
410 }
regards,
dan carpenter
next reply other threads:[~2018-05-03 11:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20180503114314epcas2p3a468e807db4c04b2f42b904c530d8565@epcas2p3.samsung.com>
2018-05-03 11:43 ` Dan Carpenter [this message]
2018-05-08 8:42 ` [bug report] [media] exynos4-is: Add the FIMC-IS ISP capture DMA driver Sylwester Nawrocki
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=20180503114301.GA7576@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=s.nawrocki@samsung.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