diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-06-18 03:05:29 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-06-26 09:03:36 -0400 |
commit | 2c30aba2b2894ceb2108f1cb2602015b121e9a81 (patch) | |
tree | 0972bcf333d5c4273167fe2b8d1f31fdb74adebb /drivers/video | |
parent | 72e5512ade915862035679ca51c4645c7fb5f1ca (diff) |
fbmem: return -EFAULT on copy_to_user() failure
copy_to_user() returns the number of bytes remaining to be copied.
put_user() returns -EFAULT on error.
This function ORs a bunch of stuff together and returns jumbled non-zero
values on error. It should return -EFAULT.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fbmem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 098bfc64cfb9..9217be3d8f3e 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1305,7 +1305,9 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix, | |||
1305 | err |= copy_to_user(fix32->reserved, fix->reserved, | 1305 | err |= copy_to_user(fix32->reserved, fix->reserved, |
1306 | sizeof(fix->reserved)); | 1306 | sizeof(fix->reserved)); |
1307 | 1307 | ||
1308 | return err; | 1308 | if (err) |
1309 | return -EFAULT; | ||
1310 | return 0; | ||
1309 | } | 1311 | } |
1310 | 1312 | ||
1311 | static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, | 1313 | static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd, |