media: qcom: venus: fix incorrect return value

[ Upstream commit 51b74c09ac ]

'pd' can be NULL, and in that case it shouldn't be passed to
PTR_ERR. Fixes a smatch warning:

drivers/media/platform/qcom/venus/pm_helpers.c:873 vcodec_domains_get() warn: passing zero to 'PTR_ERR'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Hans Verkuil 2023-10-06 12:08:47 +02:00 committed by Greg Kroah-Hartman
parent abbba0768c
commit 9649d26dc9

View File

@ -870,7 +870,7 @@ static int vcodec_domains_get(struct venus_core *core)
pd = dev_pm_domain_attach_by_name(dev, pd = dev_pm_domain_attach_by_name(dev,
res->vcodec_pmdomains[i]); res->vcodec_pmdomains[i]);
if (IS_ERR_OR_NULL(pd)) if (IS_ERR_OR_NULL(pd))
return PTR_ERR(pd) ? : -ENODATA; return pd ? PTR_ERR(pd) : -ENODATA;
core->pmdomains[i] = pd; core->pmdomains[i] = pd;
} }