[openwrt/openwrt] mac80211: ath9k: handle error from copy_to_user in read_file_eeprom
LEDE Commits
lede-commits at lists.infradead.org
Thu May 11 18:24:49 PDT 2023
ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/cbf299c86c11af950f4dbeec1b869cc51c6ea035
commit cbf299c86c11af950f4dbeec1b869cc51c6ea035
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sat May 6 12:41:46 2023 +0200
mac80211: ath9k: handle error from copy_to_user in read_file_eeprom
Handle error from copy_to_user in read_file_eeprom.
Fix compilarion warning:
/__w/openwrt/openwrt/openwrt/build_dir/target-x86_64-openwrt-linux-musl_musl/linux-x86_64/backports-6.1.24/drivers/net/wireless/ath/ath9k/debug.c: In function 'read_file_eeprom':
/__w/openwrt/openwrt/openwrt/build_dir/target-x86_64-openwrt-linux-musl_musl/linux-x86_64/backports-6.1.24/drivers/net/wireless/ath/ath9k/debug.c:1451:17: error: ignoring return value of 'copy_to_user' declared with attribute 'warn_unused_result' [-Werror=unused-result]
1451 | copy_to_user(user_buf, from, bytes);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch
index e2bbb4a1b1..b97837f76d 100644
--- a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch
+++ b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch
@@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1413,6 +1413,53 @@ void ath9k_deinit_debug(struct ath_softc
+@@ -1413,6 +1413,54 @@ void ath9k_deinit_debug(struct ath_softc
ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
}
@@ -39,7 +39,8 @@
+ } else {
+ bytes = 2;
+ }
-+ copy_to_user(user_buf, from, bytes);
++ if (copy_to_user(user_buf, from, bytes))
++ return -EFAULT;
+ user_buf += bytes;
+ }
+ return *ppos - pos;
More information about the lede-commits
mailing list