wifi: ath: dfs_pattern_detector: Fix a memory initialization issue
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 30 Sep 2023 04:54:47 +0000 (07:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:58:59 +0000 (11:58 +0100)
commit8d6a28282fee0cf2fad66ea9d3994991b9327200
tree42989beca3fd75805ff3b6a19c180bd35891f3d9
parent9b6955d524d68ea6fb225c1e7fbdcc0e41e25515
wifi: ath: dfs_pattern_detector: Fix a memory initialization issue

[ Upstream commit 79bd60ee87e1136718a686d6617ced5de88ee350 ]

If an error occurs and channel_detector_exit() is called, it relies on
entries of the 'detectors' array to be NULL.
Otherwise, it may access to un-initialized memory.

Fix it and initialize the memory, as what was done before the commit in
Fixes.

Fixes: a063b650ce5d ("ath: dfs_pattern_detector: Avoid open coded arithmetic in memory allocation")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/ad8c55b97ee4b330cb053ce2c448123c309cc91c.1695538105.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/dfs_pattern_detector.c