linux_dsm_epyc7002/drivers/isdn/pcbit
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
..
callbacks.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
callbacks.h [PATCH] drivers/isdn/pcbit/: possible cleanups 2005-06-25 16:24:56 -07:00
capi.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
capi.h [PATCH] drivers/isdn/pcbit/: possible cleanups 2005-06-25 16:24:56 -07:00
drv.c drivers/isdn: Use memdup_user 2010-05-31 00:24:15 -07:00
edss1.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
edss1.h [PATCH] drivers/isdn/pcbit/: proper prototypes 2007-02-12 09:48:34 -08:00
Kconfig Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
layer2.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
layer2.h IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
module.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
pcbit.h [PATCH] drivers/isdn/pcbit/: proper prototypes 2007-02-12 09:48:34 -08:00