Commit 3e91a38d authored by Philipp Stanner's avatar Philipp Stanner Committed by Helge Deller
Browse files

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: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarPhilipp Stanner <pstanner@redhat.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent fc6699d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);