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: e29929266b
("media: venus: Get codecs and capabilities from hfi platform")
Cc: stable@vger.kernel.org # v5.12
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
834124c596
commit
9b5d8fd580
|
@ -235,13 +235,13 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst)
|
|||
u32 enc_codecs, dec_codecs, count = 0;
|
||||
unsigned int entries;
|
||||
|
||||
if (inst)
|
||||
return 0;
|
||||
|
||||
plat = hfi_platform_get(core->res->hfi_version);
|
||||
if (!plat)
|
||||
return -EINVAL;
|
||||
|
||||
if (inst)
|
||||
return 0;
|
||||
|
||||
if (plat->codecs)
|
||||
plat->codecs(&enc_codecs, &dec_codecs, &count);
|
||||
|
||||
|
|
Loading…
Reference in New Issue