Commit 74a8c816 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kalle Valo

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: e3037485 ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/X8ilOfVz3pf0T5ec@mwanda
parent 80798201
...@@ -147,6 +147,8 @@ static int rtw_debugfs_copy_from_user(char tmp[], int size, ...@@ -147,6 +147,8 @@ static int rtw_debugfs_copy_from_user(char tmp[], int size,
{ {
int tmp_len; int tmp_len;
memset(tmp, 0, size);
if (count < num) if (count < num)
return -EFAULT; return -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment