drivers/net/wireless/wl12xx: Use kmemdup
authorJulia Lawall <julia@diku.dk>
Sat, 15 May 2010 21:16:39 +0000 (23:16 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 26 Jul 2010 19:32:40 +0000 (15:32 -0400)
commit929ebd30e4f982a1d2817f70154e7441f5714118
tree4ff2f64fb6d1e695ddc3c837b6b8c6eab64894e6
parent3289a8368c294726659588d044e354dd3bcf44b3
drivers/net/wireless/wl12xx: Use kmemdup

Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/wl1271_main.c