drm/msm: return -EFAULT if copy_from_user() fails
commit21c42da18ef128ca8fb4cc4ead888f5c61e3916a
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 16 Jan 2017 11:58:08 +0000 (16 14:58 +0300)
committerRob Clark <robdclark@gmail.com>
Mon, 6 Feb 2017 16:28:45 +0000 (6 11:28 -0500)
tree4abe4f6dfc7b39916d80f44b7dc4b78906e2ca9b
parentf079f6d999cbf857f899732de680f2b62f245b8c
drm/msm: return -EFAULT if copy_from_user() fails

copy_from_user_inatomic() is actually a local function that returns
-EFAULT or positive values on error.  Otherwise copy_from_user() returns
the number of bytes remaining to be copied.  We want to return -EFAULT
here.

I removed an unlikely() because we just did a copy_from_user()
so I don't think it can possibly make a difference.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/msm_gem_submit.c