[openwrt/openwrt] kernel: ltq-atm: add patch fixing compilation warning for ltq_atm

LEDE Commits lede-commits at lists.infradead.org
Thu May 11 18:25:26 PDT 2023


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0736cc0e67fb4c5450e62a4f857322b42e0fbc44

commit 0736cc0e67fb4c5450e62a4f857322b42e0fbc44
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu May 11 08:18:56 2023 +0200

    kernel: ltq-atm: add patch fixing compilation warning for ltq_atm
    
    Fix compilation warning caused by copy_from_user ret not handled.
    Fix compilation warning:
    /__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-atm-ase/ltq-atm/ltq_atm.c: In function 'ppe_ioctl':
    /__w/openwrt/openwrt/openwrt/build_dir/target-mips-openwrt-linux-musl_musl/linux-lantiq_ase/ltq-atm-ase/ltq-atm/ltq_atm.c:341:17: error: ignoring return value of 'copy_from_user' declared with attribute 'warn_unused_result' [-Werror=unused-result]
      341 |                 copy_from_user(&mib_vcc, arg, sizeof(mib_vcc));
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../patches/100-ltq_atm-fix-compillation-warning.patch       | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch b/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch
new file mode 100644
index 0000000000..c74cfcb6b4
--- /dev/null
+++ b/package/kernel/lantiq/ltq-atm/patches/100-ltq_atm-fix-compillation-warning.patch
@@ -0,0 +1,12 @@
+--- a/ltq_atm.c
++++ b/ltq_atm.c
+@@ -338,7 +338,8 @@ static int ppe_ioctl(struct atm_dev *dev
+ 		break;
+ 
+ 	case PPE_ATM_MIB_VCC:   /*  VCC related MIB */
+-		copy_from_user(&mib_vcc, arg, sizeof(mib_vcc));
++		if (copy_from_user(&mib_vcc, arg, sizeof(mib_vcc)))
++			return -EFAULT;
+ 		conn = find_vpivci(mib_vcc.vpi, mib_vcc.vci);
+ 		if (conn >= 0) {
+ 			mib_vcc.mib_vcc.aal5VccCrcErrors     = g_atm_priv_data.conn[conn].aal5_vcc_crc_err;




More information about the lede-commits mailing list