From: Philipp Stanner Date: Thu, 2 Nov 2023 19:24:03 +0000 (+0100) Subject: fbdev: viafb: use new array-copying-wrapper X-Git-Tag: v6.7-rc1~7^2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e91a38de1dc;p=thirdparty%2Fkernel%2Flinux.git fbdev: viafb: use new array-copying-wrapper 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 Signed-off-by: Philipp Stanner Signed-off-by: Helge Deller --- diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c index 58868f8880d65..a52b1ba43a487 100644 --- a/drivers/video/fbdev/via/viafbdev.c +++ b/drivers/video/fbdev/via/viafbdev.c @@ -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);