wlan-ng: replace calls to kmalloc and memcpy with kmemdup
authorXenia Ragiadakou <burzalodowa@gmail.com>
Mon, 13 May 2013 02:07:15 +0000 (05:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 May 2013 21:01:26 +0000 (14:01 -0700)
commit57e6d784404f796a3b8d0124210d9608ea20e279
treec2845ec6ab64affad6f9e70ca39a8b8b6b90e9fa
parentc7cd6e92ddfb16f52651fdaefde7f639f4fa4f7c
wlan-ng: replace calls to kmalloc and memcpy with kmemdup

This patch replaces calls to kmalloc that are followed
by memcpy with calls to kmemdup.
This patch was found using coccicheck with api/memdup.cocci,
with memdup.cocci script slightly altered in the following way:

@depends on patch@
expression from,to,size,flag;
position p != {r1.p,r2.p};
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = kmemdup(from,size,flag);
-  memcpy(to, from, size);

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2sta.c