]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl()
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Fri, 10 Nov 2017 18:48:50 +0000 (18:48 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 20 Nov 2017 15:57:15 +0000 (16:57 +0100)
commitc67a6bd2265742cd208d601ae03e70836d7e8fd6
tree5be55da42a111f6546deb88f82030a8afdf3fbaa
parent35f1cd0d288c7178805ae4a8279374f34cd3ad88
mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl()

hwsim_new_radio_nl() now copies the name attribute in order to add a
null-terminator.  mac80211_hwsim_new_radio() (indirectly) copies it
again into the net_device structure, so the first copy is not used or
freed later.  Free the first copy before returning.

Fixes: abaa1e19cc4e ("mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c