From: Rob Clark Date: Wed, 1 Jun 2016 18:02:51 +0000 (-0400) Subject: drm/msm: fix potential submit error path issue X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a9e26cab40ecfd4a0d718f22fa30db4dd1edbf60;p=linux-beck.git drm/msm: fix potential submit error path issue Signed-off-by: Rob Clark --- 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;