Linux Media Controller development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: stanimir.varbanov@linaro.org
Cc: linux-media@vger.kernel.org
Subject: [bug report] media: venus: Get codecs and capabilities from hfi platform
Date: Wed, 20 Jan 2021 14:01:57 +0300	[thread overview]
Message-ID: <YAgNpc/QTLnHqAW9@mwanda> (raw)

Hello Stanimir Varbanov,

The patch e29929266be1: "media: venus: Get codecs and capabilities
from hfi platform" from Aug 26, 2020, leads to the following static
checker warning:

drivers/media/platform/qcom/venus/hfi_parser.c:251 hfi_platform_parser() error: uninitialized symbol 'count'.
drivers/media/platform/qcom/venus/hfi_parser.c:254 hfi_platform_parser() error: uninitialized symbol 'enc_codecs'.
drivers/media/platform/qcom/venus/hfi_parser.c:255 hfi_platform_parser() error: uninitialized symbol 'dec_codecs'.

drivers/media/platform/qcom/venus/hfi_parser.c
   231  static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
   232  {
   233          const struct hfi_platform *plat;
   234          const struct hfi_plat_caps *caps = NULL;
   235          u32 enc_codecs, dec_codecs, count;
   236          unsigned int entries;
   237  
   238          if (inst)
   239                  return 0;
   240  
   241          plat = hfi_platform_get(core->res->hfi_version);
   242          if (!plat)
   243                  return -EINVAL;
   244  
   245          if (plat->codecs)
   246                  plat->codecs(&enc_codecs, &dec_codecs, &count);
   247  
   248          if (plat->capabilities)
   249                  caps = plat->capabilities(&entries);

These aren't initialized on the else path.

   250  
   251          if (!caps || !entries || !count)
   252                  return -EINVAL;
   253  
   254          core->enc_codecs = enc_codecs;
   255          core->dec_codecs = dec_codecs;
   256          core->codecs_count = count;
   257          core->max_sessions_supported = MAX_SESSIONS;
   258          memset(core->caps, 0, sizeof(*caps) * MAX_CODEC_NUM);
   259          memcpy(core->caps, caps, sizeof(*caps) * entries);
   260  
   261          return 0;
   262  }

regards,
dan carpenter

                 reply	other threads:[~2021-01-20 12:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=YAgNpc/QTLnHqAW9@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-media@vger.kernel.org \
    --cc=stanimir.varbanov@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox