Commit df95e2df authored by Ammar Faizi's avatar Ammar Faizi Committed by Zheng Zengkai
Browse files

wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()`

stable inclusion
from stable-v5.10.137
commit 6c5fee83bdbeffe8d607d1ab125122a75f40bd1a
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6c5fee83bdbeffe8d607d1ab125122a75f40bd1a



--------------------------------

[ Upstream commit d578e0af ]

Commit 7a483656 changes simple_write_to_buffer() with memdup_user()
but it forgets to change the value to be returned that came from
simple_write_to_buffer() call. It results in the following warning:

  warning: variable 'rc' is uninitialized when used here [-Wuninitialized]
           return rc;
                  ^~

Remove rc variable and just return the passed in length if the
memdup_user() succeeds.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Fixes: 7a483656 ("wifi: wil6210: debugfs: fix info leak in wil_write_file_wmi()")
Fixes: ff974e40 ("wil6210: debugfs interface to send raw WMI command")
Signed-off-by: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220724202452.61846-1-ammar.faizi@intel.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent cd2e28ec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment