]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: mlme: check for null after calling kmemdup
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 5 Jan 2022 08:15:59 +0000 (16:15 +0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 31 Jan 2022 14:20:12 +0000 (15:20 +0100)
commitb90b349ced460a2ac05ccfd9a03f750588074b6b
tree30f6be22db19c79fae1951092e7cd895467c6e4b
parent122bf6e0e191335ed3f17083402adb295a6f3e60
mac80211: mlme: check for null after calling kmemdup

As the possible failure of the alloc, the ifmgd->assoc_req_ies might be
NULL pointer returned from kmemdup().
Therefore it might be better to free the skb and return error in order
to fail the association, like ieee80211_assoc_success().
Also, the caller, ieee80211_do_assoc(), needs to deal with the return
value from ieee80211_send_assoc().

Fixes: e97e96b9c345 ("cfg80211: Report Association Request frame IEs in association events")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220105081559.a501790-1-jiasheng@iscas.ac.cn
[fix some paths to be errors, not success]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c