diff options
author | Jordan Crouse <jcrouse@codeaurora.org> | 2016-12-20 08:54:31 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-06 19:19:44 -0700 |
commit | 7de922c14e838c46b3ce3ff4719bbb82ee307e8d (patch) | |
tree | 79aa2bf4e832838219eefa5590ccd518a15b7318 /drivers/gpu | |
parent | b54e58ccceb794176b37037e76df3a7ed876b360 (diff) | |
download | linux-stable-7de922c14e838c46b3ce3ff4719bbb82ee307e8d.tar.gz linux-stable-7de922c14e838c46b3ce3ff4719bbb82ee307e8d.tar.bz2 linux-stable-7de922c14e838c46b3ce3ff4719bbb82ee307e8d.zip |
drm/msm: Verify that MSM_SUBMIT_BO_FLAGS are set
[ Upstream commit a6cb3b864b21b7345f824a4faa12b723c8aaf099 ]
For every submission buffer object one of MSM_SUBMIT_BO_WRITE
and MSM_SUBMIT_BO_READ must be set (and nothing else). If we
allowed zero then the buffer object would never get queued to
be unreferenced.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem_submit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 1847f83b1e33..fed44d4e5b72 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -90,7 +90,8 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, pagefault_disable(); } - if (submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) { + if ((submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) || + !(submit_bo.flags & MSM_SUBMIT_BO_FLAGS)) { DRM_ERROR("invalid flags: %x\n", submit_bo.flags); ret = -EINVAL; goto out_unlock; |