Skip to content

Commit 7de922c

Browse files
Jordan Crousegregkh
authored andcommitted
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>
1 parent b54e58c commit 7de922c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/msm/msm_gem_submit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ static int submit_lookup_objects(struct msm_gem_submit *submit,
9090
pagefault_disable();
9191
}
9292

93-
if (submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) {
93+
if ((submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) ||
94+
!(submit_bo.flags & MSM_SUBMIT_BO_FLAGS)) {
9495
DRM_ERROR("invalid flags: %x\n", submit_bo.flags);
9596
ret = -EINVAL;
9697
goto out_unlock;

0 commit comments

Comments
 (0)