]> git.baikalelectronics.ru Git - kernel.git/commit
wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()`
authorAmmar Faizi <ammarfaizi2@gnuweeb.org>
Mon, 25 Jul 2022 17:49:11 +0000 (20:49 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 27 Jul 2022 10:20:20 +0000 (13:20 +0300)
commit1eed3f1803e12d3055f393a61e3bfdeceb4376eb
tree4503ba2789114f3937a240f96ff2ff19a69d50ec
parent7c22f789c2297555c778ff6b1845ec7b79e506e5
wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()`

Commit d248abd379ab 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: d248abd379abe1cf5dac2700fcedaea0d453c96d ("wifi: wil6210: debugfs: fix info leak in wil_write_file_wmi()")
Fixes: e176ba5ffdf8fc4c613b56a82614747a0c40f930 ("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
drivers/net/wireless/ath/wil6210/debugfs.c