diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-06-08 14:40:08 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-06-08 14:40:08 -0400 |
commit | 76962be8491b18ae7ff4fd6a4accd398bdb402a2 (patch) | |
tree | 976958bf8e4989a69901bfbb25dd6463728c6cb5 /drivers/video/via/viafbdev.c | |
parent | 5e27fb78df95e027723af2c90ecc9b4527ae59e9 (diff) | |
parent | d30e5d897c3da7c2d17c8112331b66ed953eec78 (diff) |
Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
Diffstat (limited to 'drivers/video/via/viafbdev.c')
-rw-r--r-- | drivers/video/via/viafbdev.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 2bc40e682f95..1082541358f0 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -578,14 +578,9 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) | |||
578 | break; | 578 | break; |
579 | 579 | ||
580 | case VIAFB_SET_GAMMA_LUT: | 580 | case VIAFB_SET_GAMMA_LUT: |
581 | viafb_gamma_table = kmalloc(256 * sizeof(u32), GFP_KERNEL); | 581 | viafb_gamma_table = memdup_user(argp, 256 * sizeof(u32)); |
582 | if (!viafb_gamma_table) | 582 | if (IS_ERR(viafb_gamma_table)) |
583 | return -ENOMEM; | 583 | return PTR_ERR(viafb_gamma_table); |
584 | if (copy_from_user(viafb_gamma_table, argp, | ||
585 | 256 * sizeof(u32))) { | ||
586 | kfree(viafb_gamma_table); | ||
587 | return -EFAULT; | ||
588 | } | ||
589 | viafb_set_gamma_table(viafb_bpp, viafb_gamma_table); | 584 | viafb_set_gamma_table(viafb_bpp, viafb_gamma_table); |
590 | kfree(viafb_gamma_table); | 585 | kfree(viafb_gamma_table); |
591 | break; | 586 | break; |