Skip to content

Commit

Permalink
drm/msm: Fix MSM_INFO_GET_IOVA with carveout
Browse files Browse the repository at this point in the history
[ Upstream commit 6cefa31 ]

The msm_gem_get_iova should be guarded with gpu != NULL and not aspace
!= NULL, because aspace is NULL when using vram carveout.

Fixes: 933415e ("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>
  • Loading branch information
ichernev authored and gregkh committed Mar 4, 2021
1 parent 27c690b commit f38ac6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/msm/msm_drv.c
Expand Up @@ -788,9 +788,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;

/*
Expand Down

0 comments on commit f38ac6c

Please sign in to comment.