]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: mac80211: use kmemdup_array instead of kmemdup for multiple allocation
authorShen Lichuan <shenlichuan@vivo.com>
Tue, 27 Aug 2024 07:21:15 +0000 (15:21 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:28:56 +0000 (10:28 +0200)
commitd07e1f5c745058d1805e7d8042b9a326b120cb6e
treec5941072c9bf6c32512349261a817f4a06698e05
parent32bf7729d2e67aed4a6c537bf21d2023e3f39c45
wifi: mac80211: use kmemdup_array instead of kmemdup for multiple allocation

Let the kmemdup_array() take care about multiplication
and possible overflows.

Using kmemdup_array() is more appropriate and makes the code
easier to audit.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Link: https://patch.msgid.link/20240827072115.42680-1-shenlichuan@vivo.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/main.c