linux/drivers/video/via
Julia Lawall a51faabc66 drivers/video/via: use memdup_user
Use memdup_user when user data is immediately copied into the
allocated region.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = memdup_user(from,size);
   if (
-      to==NULL
+      IS_ERR(to)
                 || ...) {
   <+... when != goto l1;
-  -ENOMEM
+  PTR_ERR(to)
   ...+>
   }
-  if (copy_from_user(to, from, size) != 0) {
-    <+... when != goto l2;
-    -EFAULT
-    ...+>
-  }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Joseph Chan <JosephChan@via.com.tw>
Cc: Scott Fang <ScottFang@viatech.com.cn>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:42 -07:00
..
accel.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
accel.h
chip.h
debug.h
dvi.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
dvi.h
global.c
global.h
hw.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
hw.h
ioctl.c
ioctl.h
lcd.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
lcd.h
lcdtbl.h
Makefile
share.h
tbl1636.c
tbl1636.h
tblDPASetting.c
tblDPASetting.h
via_i2c.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
via_modesetting.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
via_modesetting.h
via_utility.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
via_utility.h
via-core.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
via-gpio.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
viafbdev.c drivers/video/via: use memdup_user 2010-05-27 09:12:42 -07:00
viafbdev.h
viamode.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
viamode.h
vt1636.c viafb: move some include files to include/linux 2010-05-11 16:07:59 -06:00
vt1636.h