Skip to content

Commit

Permalink
media: qcom: venus: fix incorrect return value
Browse files Browse the repository at this point in the history
[ Upstream commit 51b74c0 ]

'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 <[email protected]>
Reviewed-by: Bryan O'Donoghue <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Hans Verkuil authored and Sasha Levin committed Aug 25, 2024
1 parent fe23659 commit 8025319
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/platform/qcom/venus/pm_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ static int vcodec_domains_get(struct venus_core *core)
pd = dev_pm_domain_attach_by_name(dev,
res->vcodec_pmdomains[i]);
if (IS_ERR_OR_NULL(pd))
return PTR_ERR(pd) ? : -ENODATA;
return pd ? PTR_ERR(pd) : -ENODATA;
core->pmdomains[i] = pd;
}

Expand Down

0 comments on commit 8025319

Please sign in to comment.