mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-03 15:55:38 +00:00
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>
This commit is contained in:
parent
4856bfd230
commit
90abf96abd
1 changed files with 1 additions and 2 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue