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/cxgb3
Julia Lawall c5dc9a3581 drivers/net/cxgb3: 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:13 -07:00
..
adapter.h RDMA/cxgb3: Doorbell overflow avoidance and recovery 2010-02-24 10:40:28 -08:00
ael1002.c cxgb3: fix linkup issue 2010-04-21 16:34:41 -07:00
aq100x.c
common.h cxgb3: convert to use netdev_for_each_addr 2010-02-17 15:59:48 -08:00
cxgb3_ctl_defs.h
cxgb3_defs.h
cxgb3_ioctl.h
cxgb3_main.c drivers/net/cxgb3: Use memdup_user 2010-05-31 00:24:13 -07:00
cxgb3_offload.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
cxgb3_offload.h RDMA/cxgb3: Doorbell overflow avoidance and recovery 2010-02-24 10:40:28 -08:00
firmware_exports.h
l2t.c drivers/net: Remove unnecessary returns from void function()s 2010-05-14 00:19:28 -07:00
l2t.h
Makefile
mc5.c
regs.h RDMA/cxgb3: Doorbell overflow avoidance and recovery 2010-02-24 10:40:28 -08:00
sge.c cxgb3: use the DMA state API instead of the pci equivalents 2010-04-13 02:54:18 -07:00
sge_defs.h
t3_cpl.h
t3_hw.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2010-03-03 07:33:17 -08:00
t3cdev.h
version.h
vsc8211.c
xgmac.c net: convert multicast list to list_head 2010-04-03 14:22:15 -07:00