mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
wifi: wil6210: debugfs: fix uninitialized variable use in wil_write_file_wmi()
[ Upstream commitd578e0af3a
] Commit7a4836560a
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: kernel test robot <lkp@intel.com> Fixes:7a4836560a
("wifi: wil6210: debugfs: fix info leak in wil_write_file_wmi()") Fixes:ff974e4083
("wil6210: debugfs interface to send raw WMI command") Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://lore.kernel.org/r/20220724202452.61846-1-ammar.faizi@intel.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a06af2a004
commit
c9fde3a44d
1 changed files with 2 additions and 2 deletions
|
@ -1002,7 +1002,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
|
|||
void *cmd;
|
||||
int cmdlen = len - sizeof(struct wmi_cmd_hdr);
|
||||
u16 cmdid;
|
||||
int rc, rc1;
|
||||
int rc1;
|
||||
|
||||
if (cmdlen < 0 || *ppos != 0)
|
||||
return -EINVAL;
|
||||
|
@ -1019,7 +1019,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
|
|||
|
||||
wil_info(wil, "0x%04x[%d] -> %d\n", cmdid, cmdlen, rc1);
|
||||
|
||||
return rc;
|
||||
return len;
|
||||
}
|
||||
|
||||
static const struct file_operations fops_wmi = {
|
||||
|
|
Loading…
Reference in a new issue