Linux Media Controller development
 help / color / mirror / Atom feed
* [bug report] media: venus: Get codecs and capabilities from hfi platform
@ 2021-01-20 11:01 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-01-20 11:01 UTC (permalink / raw)
  To: stanimir.varbanov; +Cc: linux-media

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-20 12:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-20 11:01 [bug report] media: venus: Get codecs and capabilities from hfi platform Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox