Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/net/wan
Julia Lawall 7d88950426 drivers/net/wan: 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:14 -07:00
..
lmc net: trans_start cleanups 2010-05-10 05:01:31 -07:00
.gitignore
c101.c
cosa.c
cosa.h
cycx_drv.c
cycx_main.c
cycx_x25.c X25: Use identifiers for cyclades device to x25 interface 2010-04-22 16:12:50 -07:00
dlci.c
dscc4.c net: trans_start cleanups 2010-05-10 05:01:31 -07:00
farsync.c drivers/net/wan: Use memdup_user 2010-05-31 00:24:14 -07:00
farsync.h
hd64570.c net: trans_start cleanups 2010-05-10 05:01:31 -07:00
hd64570.h
hd64572.c net: trans_start cleanups 2010-05-10 05:01:31 -07:00
hd64572.h
hdlc.c
hdlc_cisco.c
hdlc_fr.c
hdlc_ppp.c
hdlc_raw.c
hdlc_raw_eth.c
hdlc_x25.c X25: Use identifiers for hdlc x25 device to x25 interface 2010-04-22 16:12:51 -07:00
hostess_sv11.c
ixp4xx_hss.c net: trans_start cleanups 2010-05-10 05:01:31 -07:00
Kconfig
lapbether.c X25: Use identifiers for lapbether device to x25 interface 2010-04-22 16:12:50 -07:00
Makefile
n2.c
pc300-falc-lh.h
pc300.h
pc300_drv.c net: trans_start cleanups 2010-05-10 05:01:31 -07:00
pc300_tty.c
pc300too.c
pci200syn.c
sbni.c
sbni.h
sdla.c drivers/net/wan: Use memdup_user 2010-05-31 00:24:13 -07:00
sealevel.c
wanxl.c net: trans_start cleanups 2010-05-10 05:01:31 -07:00
wanxl.h
wanxlfw.inc_shipped
wanxlfw.S
x25_asy.c X25: Use identifiers for x25 async device to x25 interface 2010-04-22 16:12:49 -07:00
x25_asy.h
z85230.c
z85230.h