]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
fbdev: viafb: use new array-copying-wrapper
authorPhilipp Stanner <pstanner@redhat.com>
Thu, 2 Nov 2023 19:24:03 +0000 (20:24 +0100)
committerHelge Deller <deller@gmx.de>
Tue, 7 Nov 2023 13:42:34 +0000 (14:42 +0100)
viafbdev.c utilizes memdup_user() to copy an array from userspace.

There is a new wrapper, specifically designed for copying arrays. Use
this one instead.

Suggested-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/via/viafbdev.c

index 58868f8880d655b771755002ee1804655078609c..a52b1ba43a48744a5e7609080a48609ea8a3cd1a 100644 (file)
@@ -574,7 +574,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
                break;
 
        case VIAFB_SET_GAMMA_LUT:
-               viafb_gamma_table = memdup_user(argp, 256 * sizeof(u32));
+               viafb_gamma_table = memdup_array_user(argp, 256, sizeof(u32));
                if (IS_ERR(viafb_gamma_table))
                        return PTR_ERR(viafb_gamma_table);
                viafb_set_gamma_table(viafb_bpp, viafb_gamma_table);