linux/drivers/staging/dream
Julia Lawall 37a18632b0 Staging: dream: camera: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 15:16:21 -07:00
..
camera Staging: dream: camera: Use memdup_user 2010-06-18 15:16:21 -07:00
include Staging: dream: add missing include files 2010-03-03 16:42:26 -08:00
qdsp5 Staging: dream: remove last bits of earlysuspend support 2010-05-11 11:35:37 -07:00
generic_gpio.c Staging: dream: add gpio and pmem support 2009-12-11 12:23:21 -08:00
gpio_axis.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
gpio_event.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
gpio_input.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
gpio_matrix.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
gpio_output.c Staging: dream: add support for input on GPIO pins 2009-09-15 12:02:05 -07:00
Kconfig staging: dream: smd: remove all smd related code 2010-05-14 13:21:30 -07:00
Makefile staging: dream: smd: remove all smd related code 2010-05-14 13:21:30 -07:00
pmem.c Staging: Use kcalloc or kzalloc 2010-05-14 14:02:56 -07:00
synaptics_i2c_rmi.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
synaptics_i2c_rmi.h Staging: HTC Dream: touchscreen driver for staging 2009-09-15 12:02:04 -07:00
TODO Staging: dream: remove last bits of earlysuspend support 2010-05-11 11:35:37 -07:00