Skip to content

Commit 51b74c0

Browse files
author
Hans Verkuil
committed
media: qcom: venus: fix incorrect return value
'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]>
1 parent b925fb4 commit 51b74c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ static int vcodec_domains_get(struct venus_core *core)
870870
pd = dev_pm_domain_attach_by_name(dev,
871871
res->vcodec_pmdomains[i]);
872872
if (IS_ERR_OR_NULL(pd))
873-
return PTR_ERR(pd) ? : -ENODATA;
873+
return pd ? PTR_ERR(pd) : -ENODATA;
874874
core->pmdomains[i] = pd;
875875
}
876876

0 commit comments

Comments
 (0)