Commit 3c77ff8f authored by Kangjie Lu's avatar Kangjie Lu Committed by Eric Anholt

drm/v3d: fix a missing check of pm_runtime_get_sync

pm_runtime_get_sync could fail and thus deserves a check.

The patch adds such a check and return its error code upstream
if it indeed failed.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190324231602.2436-1-kjlu@umn.eduReviewed-by: default avatarMukesh Ojha <mojha@codeaurora.org>
parent f8b34706
...@@ -102,6 +102,8 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data, ...@@ -102,6 +102,8 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
return -EINVAL; return -EINVAL;
ret = pm_runtime_get_sync(v3d->dev); ret = pm_runtime_get_sync(v3d->dev);
if (ret < 0)
return ret;
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 && if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) { args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
args->value = V3D_CORE_READ(0, offset); args->value = V3D_CORE_READ(0, offset);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment