Skip to content

Commit 9b5d8fd

Browse files
Stanimir Varbanovmchehab
authored andcommitted
media: venus: hfi_parser: Check for instance after hfi platform get
The inst function argument is != NULL only for Venus v1 and we did not migrate v1 to a hfi_platform abstraction yet. So check for instance != NULL only after hfi_platform_get returns no error. Fixes: e299292 ("media: venus: Get codecs and capabilities from hfi platform") Cc: [email protected] # v5.12 Signed-off-by: Stanimir Varbanov <[email protected]> Tested-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 834124c commit 9b5d8fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
235235
u32 enc_codecs, dec_codecs, count = 0;
236236
unsigned int entries;
237237

238-
if (inst)
239-
return 0;
240-
241238
plat = hfi_platform_get(core->res->hfi_version);
242239
if (!plat)
243240
return -EINVAL;
244241

242+
if (inst)
243+
return 0;
244+
245245
if (plat->codecs)
246246
plat->codecs(&enc_codecs, &dec_codecs, &count);
247247

0 commit comments

Comments
 (0)