linux/drivers/s390
Julia Lawall 4986f3f01a qeth: 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: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-23 12:36:25 -07:00
..
block [S390] dasd: unit check handling during internal cio I/O 2010-05-26 23:27:09 +02:00
char Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-05-20 09:20:59 -07:00
cio [S390] cio: unit check handling during internal I/O 2010-05-26 23:27:09 +02:00
crypto [S390] avoid default_llseek in s390 drivers 2010-05-17 10:00:16 +02:00
kvm 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
net qeth: Use memdup_user when user data is immediately copied into the allocated region. 2010-07-23 12:36:25 -07:00
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2010-05-21 07:19:18 -07:00
Makefile [S390] split/move machine check handler code 2009-03-26 15:24:10 +01:00