]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtw88: fix memory overrun and memory leak during hw_scan
authorPo-Hao Huang <phhuang@realtek.com>
Fri, 21 Jan 2022 07:08:13 +0000 (15:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:59 +0000 (13:57 +0200)
commitec5da191bfcd5fd22b95459b623694f66c1cc10b
treebd9a38963cc16dd00f36745e15bfe73d4e3e61f2
parent2dbd48fd5d19d37616455631bf76869c88f8598b
rtw88: fix memory overrun and memory leak during hw_scan

[ Upstream commit d95984b5580dcb8b1c0036577c52b609990a1dab ]

Previously we allocated less memory than actual required, overwrite
to the buffer causes the mm module to complaint and raise access
violation faults. Along with potential memory leaks when returned
early. Fix these by passing the correct size and proper deinit flow.

Fixes: 10d162b2ed39 ("rtw88: 8822c: add ieee80211_ops::hw_scan")
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220121070813.9656-4-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtw88/fw.c