Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90abf96a authored by YueHaibing's avatar YueHaibing Committed by Johannes Berg
Browse files

cfg80211: Use kmemdup in cfg80211_gen_new_ie()



Use kmemdup rather than duplicating its implementation

Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 4856bfd2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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];