summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIskren Chernev <iskren.chernev@gmail.com>2021-01-02 23:24:37 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-04 13:38:12 +0300
commitb016a9f0c546a75319da0f8eb43b4b7a720d45f6 (patch)
treeb2bb01e1274c3377e005eea634fcaba23e795c9e
parentbede9ad9196cf420c55ff89c28b2e486affc5fd0 (diff)
downloadlinux-b016a9f0c546a75319da0f8eb43b4b7a720d45f6.tar.xz
drm/msm: Fix MSM_INFO_GET_IOVA with carveout
[ Upstream commit 6cefa31e810404dafdfcdb94874146cea11626c2 ] The msm_gem_get_iova should be guarded with gpu != NULL and not aspace != NULL, because aspace is NULL when using vram carveout. Fixes: 933415e24bd0d ("drm/msm: Add support for private address space instances") Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com> Tested-by: Alexey Minnekhanov <alexeymin@postmarketos.org> Signed-off-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index d556c353e5ae..3d0adfa6736a 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -775,9 +775,10 @@ static int msm_ioctl_gem_info_iova(struct drm_device *dev,
struct drm_file *file, struct drm_gem_object *obj,
uint64_t *iova)
{
+ struct msm_drm_private *priv = dev->dev_private;
struct msm_file_private *ctx = file->driver_priv;
- if (!ctx->aspace)
+ if (!priv->gpu)
return -EINVAL;
/*