Skip to content
Commit d9e709d0 authored by Shreeya Patel's avatar Shreeya Patel Committed by Greg Kroah-Hartman
Browse files

Staging: wilc1000: cfg80211: Use kmemdup instead of kmalloc and memcpy



Replace calls to kmalloc followed by a memcpy with a direct call to
kmemdup.

The Coccinelle semantic patch used to make this change is as follows:
@@
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);

Signed-off-by: default avatarShreeya Patel <shreeya.patel23498@gmail.com>
Reviewed-by: default avatarStefano Brivio <sbrivio@redhat.com>
Link: https://lore.kernel.org/r/20200313112451.25610-1-shreeya.patel23498@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 76498b49
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment