Skip to content

Commit c5b14df

Browse files
Colin Ian Kingmchehab
authored andcommitted
media: venus: Fix uninitialized variable count being checked for zero
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 <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent b08797d commit c5b14df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/platform/qcom/venus/hfi_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
232232
{
233233
const struct hfi_platform *plat;
234234
const struct hfi_plat_caps *caps = NULL;
235-
u32 enc_codecs, dec_codecs, count;
235+
u32 enc_codecs, dec_codecs, count = 0;
236236
unsigned int entries;
237237

238238
if (inst)

0 commit comments

Comments
 (0)