linux/drivers/telephony
Julia Lawall b8d6b0d6b6 drivers/telephony/ixj.c: 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:42 -07:00
..
ixj_pcmcia.c pcmcia: dev_node removal (write-only drivers) 2010-05-10 10:23:14 +02:00
ixj-ver.h
ixj.c drivers/telephony/ixj.c: use memdup_user 2010-05-27 09:12:42 -07:00
ixj.h [PATCH] drivers/telephony/ixj: Convert to generic boolean 2007-02-12 09:48:30 -08:00
Kconfig kconfig: syntax cleanup - drop support for "depends/requires/def_boolean" 2007-10-12 21:20:32 +02:00
Makefile
phonedev.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00