Patch "wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()`" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

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

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-wil6210-debugfs-fix-uninitialized-variable-use-.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 886e789c3cd75ad56fbc82ea6737b51bd3d1812a
Author: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
Date:   Mon Jul 25 20:49:11 2022 +0300

    wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()`
    
    [ Upstream commit d578e0af3a003736f6c440188b156483d451b329 ]
    
    Commit 7a4836560a61 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@xxxxxxxxxx>
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Fixes: 7a4836560a6198d245d5732e26f94898b12eb760 ("wifi: wil6210: debugfs: fix info leak in wil_write_file_wmi()")
    Fixes: ff974e4083341383d3dd4079e52ed30f57f376f0 ("wil6210: debugfs interface to send raw WMI command")
    Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx>
    Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Signed-off-by: Kalle Valo <quic_kvalo@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220724202452.61846-1-ammar.faizi@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 675b2829b4c7..3a46b319e9f1 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -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 = {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux