Skip to content

Commit

Permalink
media: venus: Fix uninitialized variable count being checked for zero
Browse files Browse the repository at this point in the history
In the case where plat->codecs is NULL the variable count is uninitialized
but is being checked to see if it is 0. Fix this by initializing
count to 0.

Addresses-Coverity: ("Uninitialized scalar variable")

Fixes: e299292 ("media: venus: Get codecs and capabilities from hfi platform")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Colin Ian King authored and Mauro Carvalho Chehab committed Jan 27, 2021
1 parent b08797d commit c5b14df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/platform/qcom/venus/hfi_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
{
const struct hfi_platform *plat;
const struct hfi_plat_caps *caps = NULL;
u32 enc_codecs, dec_codecs, count;
u32 enc_codecs, dec_codecs, count = 0;
unsigned int entries;

if (inst)
Expand Down

0 comments on commit c5b14df

Please sign in to comment.