summaryrefslogtreecommitdiffstats
path: root/net/wireless/scan.c
diff options
context:
space:
mode:
authorYueHaibing2019-02-25 13:38:49 +0100
committerJohannes Berg2019-03-29 11:22:55 +0100
commit90abf96abd9bb00f36c8d3640255e6bfa73f7495 (patch)
tree83f1210eef2e5332b96ed54267ad889a4a000bc1 /net/wireless/scan.c
parentmac80211: do not call driver wake_tx_queue op during reconfig (diff)
downloadkernel-qcow2-linux-90abf96abd9bb00f36c8d3640255e6bfa73f7495.tar.gz
kernel-qcow2-linux-90abf96abd9bb00f36c8d3640255e6bfa73f7495.tar.xz
kernel-qcow2-linux-90abf96abd9bb00f36c8d3640255e6bfa73f7495.zip
cfg80211: Use kmemdup in cfg80211_gen_new_ie()
Use kmemdup rather than duplicating its implementation Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r--net/wireless/scan.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 287518c6caa4..04d888628f29 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -190,10 +190,9 @@ static size_t cfg80211_gen_new_ie(const u8 *ie, size_t ielen,
/* copy subelement as we need to change its content to
* mark an ie after it is processed.
*/
- sub_copy = kmalloc(subie_len, gfp);
+ sub_copy = kmemdup(subelement, subie_len, gfp);
if (!sub_copy)
return 0;
- memcpy(sub_copy, subelement, subie_len);
pos = &new_ie[0];