OSDN Git Service

mwifiex: fix potential NULL dereference and use after free
authorPan Bian <bianpan2016@163.com>
Thu, 29 Nov 2018 10:25:19 +0000 (18:25 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 13 Dec 2018 14:53:42 +0000 (16:53 +0200)
commit1dcd9429212b98bea87fc6ec92fb50bf5953eb47
tree535b65cf3d29d0291cb2c53d90ac9cb3f846c0b5
parent074b145a05835e9f93a52323a4770b70b4b782fd
mwifiex: fix potential NULL dereference and use after free

There are two defects: (1) passing a NULL bss to
mwifiex_save_hidden_ssid_channels will result in NULL dereference,
(2) using bss after dropping the reference to it via cfg80211_put_bss.
To fix them, the patch moves the buggy code to the branch that bss is
not NULL and puts it before cfg80211_put_bss.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/scan.c