All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: hugues.fruchet@st.com
Cc: linux-media@vger.kernel.org
Subject: [bug report] [media] st-delta: add mjpeg support
Date: Mon, 13 Feb 2017 22:07:04 +0300	[thread overview]
Message-ID: <20170213190704.GA7539@mwanda> (raw)

Hello Hugues Fruchet,

The patch 433ff5b4a29b: "[media] st-delta: add mjpeg support" from
Feb 2, 2017, leads to the following static checker warning:

	drivers/media/platform/sti/delta/delta-mjpeg-dec.c:415 delta_mjpeg_decode()
	error: uninitialized symbol 'data_offset'.

drivers/media/platform/sti/delta/delta-mjpeg-dec.c
   378          unsigned int data_offset;
                             ^^^^^^^^^^^
   379          struct mjpeg_header *header = &ctx->header_struct;
   380  
   381          if (!ctx->header) {
   382                  ret = delta_mjpeg_read_header(pctx, au.vaddr, au.size,
   383                                                header, &data_offset);
                                                               ^^^^^^^^^^^
It's not immediately clear that "data_offset" must be set on the
success path.

   384                  if (ret) {
   385                          pctx->stream_errors++;
   386                          goto err;
   387                  }
   388                  if (header->frame_width * header->frame_height >
   389                      DELTA_MJPEG_MAX_RESO) {
   390                          dev_err(delta->dev,
   391                                  "%s  stream resolution too large: %dx%d > %d pixels budget\n",
   392                                  pctx->name,
   393                                  header->frame_width,
   394                                  header->frame_height, DELTA_MJPEG_MAX_RESO);
   395                          ret = -EINVAL;
   396                          goto err;
   397                  }
   398                  ctx->header = header;
   399                  goto out;
   400          }
   401  
   402          if (!ctx->ipc_hdl) {
   403                  ret = delta_mjpeg_ipc_open(pctx);
   404                  if (ret)
   405                          goto err;
   406          }
   407  
   408          ret = delta_mjpeg_read_header(pctx, au.vaddr, au.size,
   409                                        ctx->header, &data_offset);
   410          if (ret) {
   411                  pctx->stream_errors++;
   412                  goto err;
   413          }
   414  
   415          au.paddr += data_offset;
                ^^^^^^^^^^^^^^^^^^^^^^^
   416          au.vaddr += data_offset;

regards,
dan carpenter

             reply	other threads:[~2017-02-13 19:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 19:07 Dan Carpenter [this message]
2017-02-21  9:14 ` [bug report] [media] st-delta: add mjpeg support Hugues FRUCHET

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=20170213190704.GA7539@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=hugues.fruchet@st.com \
    --cc=linux-media@vger.kernel.org \
    /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.