aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter2020-12-03 11:43:37 +0300
committerKalle Valo2020-12-03 18:00:45 +0200
commit74a8c816fa8fa7862df870660e9821abb56649fe (patch)
tree4bb4217bf4c0ad15a41b89acc3bdac0ff3ee738e
parent807982017730cfe853fce49ba26d453e31c84898 (diff)
rtw88: debug: Fix uninitialized memory in debugfs code
This code does not ensure that the whole buffer is initialized and none of the callers check for errors so potentially none of the buffer is initialized. Add a memset to eliminate this bug. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/X8ilOfVz3pf0T5ec@mwanda
-rw-r--r--drivers/net/wireless/realtek/rtw88/debug.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index 3852c4f0ac0b..efbba9caef3b 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -147,6 +147,8 @@ static int rtw_debugfs_copy_from_user(char tmp[], int size,
{
int tmp_len;
+ memset(tmp, 0, size);
+
if (count < num)
return -EFAULT;