diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-02-25 15:38:49 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2019-03-29 13:22:55 +0300 |
commit | 90abf96abd9bb00f36c8d3640255e6bfa73f7495 (patch) | |
tree | 83f1210eef2e5332b96ed54267ad889a4a000bc1 /net/wireless/scan.c | |
parent | 4856bfd230985e43e84c26473c91028ff0a533bd (diff) | |
download | linux-90abf96abd9bb00f36c8d3640255e6bfa73f7495.tar.xz |
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.c | 3 |
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]; |