2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 14:14:01 +08:00
linux-next/drivers/isdn/sc
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
..
card.h [ISDN] sc: Fix sndpkt to have the correct number of arguments 2007-11-14 15:57:38 -08:00
command.c isdn/sc: compile breakage re check_reset() 2007-07-19 10:04:50 -07:00
event.c [PATCH] drivers/isdn/sc/: proper prototypes 2007-02-12 09:48:34 -08:00
hardware.h tree-wide: fix typos "ammount" -> "amount" 2010-02-05 12:22:40 +01:00
includes.h isdn/sc: remove unused REQUEST_IRQ and unnecessary header file 2007-10-19 11:53:34 -07:00
init.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
interrupt.c isdn/sc: irq handler clean 2007-10-23 19:53:16 -04:00
ioctl.c drivers/isdn: Use memdup_user 2010-05-31 00:24:15 -07:00
Kconfig Kconfig: Remove useless and sometimes wrong comments 2009-11-09 09:40:56 +01:00
Makefile
message.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
message.h
packet.c [ISDN] sc: Fix sndpkt to have the correct number of arguments 2007-11-14 15:57:38 -08:00
scioc.h [PATCH] drivers/isdn/sc/: proper prototypes 2007-02-12 09:48:34 -08:00
shmem.c ISDN: fix sc/shmem printk format warning 2009-02-20 00:54:44 -08:00
timer.c isdn/sc: compile breakage re check_reset() 2007-07-19 10:04:50 -07:00