alistair23-linux/drivers/isdn/i4l
Julia Lawall 024cb8a67f drivers/isdn: 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: David S. Miller <davem@davemloft.net>
2010-05-31 00:24:15 -07:00
..
isdn_audio.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
isdn_audio.h
isdn_bsdcomp.c
isdn_common.c isdn: Push down BKL into ioctl functions 2010-05-17 05:27:05 +02:00
isdn_common.h
isdn_concap.c
isdn_concap.h
isdn_net.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
isdn_net.h
isdn_ppp.c drivers/isdn: Use memdup_user 2010-05-31 00:24:15 -07:00
isdn_ppp.h
isdn_tty.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
isdn_tty.h
isdn_ttyfax.c
isdn_ttyfax.h
isdn_v110.c
isdn_v110.h
isdn_x25iface.c X25: Use identifiers for isdn device to x25 interface 2010-04-22 16:12:48 -07:00
isdn_x25iface.h
isdnhdlc.c
Kconfig
Makefile