diff options
author | Rob Clark <robdclark@gmail.com> | 2016-06-01 14:02:51 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2016-06-04 14:45:50 -0400 |
commit | a9e26cab40ecfd4a0d718f22fa30db4dd1edbf60 (patch) | |
tree | 91729ef78ced96c38368adcafa32127ec51d7dcf /drivers/gpu/drm/msm/msm_gem_submit.c | |
parent | ba344afd667a6f1c6bf7c53e08fc16bd84fa4df7 (diff) | |
download | linux-a9e26cab40ecfd4a0d718f22fa30db4dd1edbf60.tar.gz linux-a9e26cab40ecfd4a0d718f22fa30db4dd1edbf60.tar.bz2 linux-a9e26cab40ecfd4a0d718f22fa30db4dd1edbf60.zip |
drm/msm: fix potential submit error path issue
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem_submit.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem_submit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 635eff17c3d1..eb4bb8b2f3a5 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -77,6 +77,11 @@ static int submit_lookup_objects(struct msm_gem_submit *submit, void __user *userptr = u64_to_user_ptr(args->bos + (i * sizeof(submit_bo))); + /* make sure we don't have garbage flags, in case we hit + * error path before flags is initialized: + */ + submit->bos[i].flags = 0; + ret = copy_from_user(&submit_bo, userptr, sizeof(submit_bo)); if (ret) { ret = -EFAULT; |