WSL2-Linux-Kernel/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
..
Makefile cxgb3: add support for the Aquantia 10G-BT phy 2009-05-29 15:55:05 -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 cxgb3: AQ100X phy support update 2009-07-08 10:54:18 -07:00
common.h cxgb3: convert to use netdev_for_each_addr 2010-02-17 15:59:48 -08:00
cxgb3_ctl_defs.h cxgb3: add control to access embedded images 2008-12-26 01:16:39 -08:00
cxgb3_defs.h cxgb3: extend copyrights to 2008 2008-10-13 18:47:30 -07:00
cxgb3_ioctl.h cxgb3: extend copyrights to 2008 2008-10-13 18:47:30 -07:00
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 cxgb3: extend copyrights to 2008 2008-10-13 18:47:30 -07:00
l2t.c drivers/net: Remove unnecessary returns from void function()s 2010-05-14 00:19:28 -07:00
l2t.h cxgb3: extend copyrights to 2008 2008-10-13 18:47:30 -07:00
mc5.c cxgb3: extend copyrights to 2008 2008-10-13 18:47:30 -07:00
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 cxgb3 - Set the CQ_ERR bit in CQ contexts. 2007-10-10 16:51:05 -07:00
t3_cpl.h cxgb3: extend copyrights to 2008 2008-10-13 18:47:30 -07:00
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 cxgb3: extend copyrights to 2008 2008-10-13 18:47:30 -07:00
version.h cxgb3: Update FW to 7.4.0 2009-06-03 21:01:50 -07:00
vsc8211.c cxgb3: Use generic MDIO definitions and mdio_mii_ioctl() 2009-04-29 17:32:32 -07:00
xgmac.c net: convert multicast list to list_head 2010-04-03 14:22:15 -07:00