diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-10-06 12:08:47 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-10-12 10:12:54 +0200 |
commit | 51b74c09ac8c5862007fc2bf0d465529d06dd446 (patch) | |
tree | 98c548d69eacd9b1bbfff69fce4d92f9a3ada27a | |
parent | b925fb423d3c9aa5cf24bd5e4953649fcf271245 (diff) | |
download | lwn-51b74c09ac8c5862007fc2bf0d465529d06dd446.tar.gz lwn-51b74c09ac8c5862007fc2bf0d465529d06dd446.zip |
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 <hverkuil-cisco@xs4all.nl>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
-rw-r--r-- | drivers/media/platform/qcom/venus/pm_helpers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 48c9084bb4db..a1b127caa90a 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -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; } |