fbmem: return -EFAULT on copy_to_user() failure
Subsystems (2)
PATCH 1/1 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 <[email protected]>
drivers/video/fbmem.c +3 -1
@@ -1305,7 +1305,9 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix, err |=copy_to_user (fix32->reserved, fix->reserved,sizeof (fix->reserved)); -return err; +if (err) +return -EFAULT ; +return 0 ; } static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,
Quoted 13 lines · Dan Carpenter
copy_to_user()returns the number of bytes remaining to be copied.put_user()returns-EFAULTon 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 <[email protected]>drivers/video/fbmem.c +0
-0
drivers/video/fbmem.c static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix, · line 1313
Quoted 10 lines
drivers/video/fbmem.c +3
-1@@ -1305,7 +1305,9 @@ static int do_fscreeninfo_to_user(struct fb_fix_screeninfo *fix, err |=copy_to_user (fix32->reserved, fix->reserved,sizeof (fix->reserved)); -return err; +if (err) +return -EFAULT ; +return 0 ; } static int fb_get_fscreeninfo(struct fb_info *info, unsigned int cmd,
I've added this to fbdev-3.11 branch.
Tomi