All of lore.kernel.org
 help / color / mirror / Atom feed
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: re: [media] exynos4-is: Add the FIMC-IS ISP capture DMA driver
Date: Thu, 8 May 2014 16:16:20 +0300	[thread overview]
Message-ID: <20140508131620.GA7606@mwanda> (raw)

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:415 isp_video_try_fmt_mplane()
	error: XXX NULL dereference inside function. '()' '0'

drivers/media/platform/exynos4-is/fimc-isp-video.c
   390  static void __isp_video_try_fmt(struct fimc_isp *isp,
   391                                  struct v4l2_pix_format_mplane *pixm,
   392                                  const struct fimc_fmt **fmt)
   393  {
   394          *fmt = fimc_isp_find_format(&pixm->pixelformat, NULL, 2);
   395  
   396          pixm->colorspace = V4L2_COLORSPACE_SRGB;
   397          pixm->field = V4L2_FIELD_NONE;
   398          pixm->num_planes = (*fmt)->memplanes;
   399          pixm->pixelformat = (*fmt)->fourcc;
   400          /*
   401           * TODO: double check with the docmentation these width/height
   402           * constraints are correct.
   403           */
   404          v4l_bound_align_image(&pixm->width, FIMC_ISP_SOURCE_WIDTH_MIN,
   405                                FIMC_ISP_SOURCE_WIDTH_MAX, 3,
   406                                &pixm->height, FIMC_ISP_SOURCE_HEIGHT_MIN,
   407                                FIMC_ISP_SOURCE_HEIGHT_MAX, 0, 0);
   408  }
   409  
   410  static int isp_video_try_fmt_mplane(struct file *file, void *fh,
   411                                          struct v4l2_format *f)
   412  {
   413          struct fimc_isp *isp = video_drvdata(file);
   414  
   415          __isp_video_try_fmt(isp, &f->fmt.pix_mp, NULL);
                                                         ^^^^
This will just NULL deref.  What was intended?

   416          return 0;
   417  }

regards,
dan carpenter

             reply	other threads:[~2014-05-08 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 13:16 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-02 12:16 [media] exynos4-is: Add the FIMC-IS ISP capture DMA driver Dan Carpenter

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=20140508131620.GA7606@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.