Skip to content

Commit

Permalink
drm/v3d: fix a missing check of pm_runtime_get_sync
Browse files Browse the repository at this point in the history
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: Kangjie Lu <[email protected]>
Signed-off-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Mukesh Ojha <[email protected]>
  • Loading branch information
kengiter authored and anholt committed Apr 1, 2019
1 parent f8b3470 commit 3c77ff8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/v3d/v3d_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
return -EINVAL;

ret = pm_runtime_get_sync(v3d->dev);
if (ret < 0)
return ret;
if (args->param >= DRM_V3D_PARAM_V3D_CORE0_IDENT0 &&
args->param <= DRM_V3D_PARAM_V3D_CORE0_IDENT2) {
args->value = V3D_CORE_READ(0, offset);
Expand Down

0 comments on commit 3c77ff8

Please sign in to comment.