From: Christian Marangi Date: Fri, 12 May 2023 17:41:14 +0000 (+0200) Subject: rtpengine: add patch fixing compilation warning for kernel module X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f265a9399173dd9cf705c298652816e4fb948714;p=feed%2Ftelephony.git rtpengine: add patch fixing compilation warning for kernel module Add patch fixing compilation warning for kernel module. Always dynamically allocate buffer for proc_control_read_write. Fix compilation warning: /builder/shared-workdir/build/build_dir/target-arm_cortex-a8+vfpv3_musl_eabi/rtpengine-no-transcode/rtpengine-mr10.5.2.6/kernel-module/xt_RTPENGINE.c: In function 'proc_control_read_write': /builder/shared-workdir/build/build_dir/target-arm_cortex-a8+vfpv3_musl_eabi/rtpengine-no-transcode/rtpengine-mr10.5.2.6/kernel-module/xt_RTPENGINE.c:3573:1: error: the frame size of 1272 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] 3573 | } | ^ Signed-off-by: Christian Marangi --- diff --git a/net/rtpengine/patches/07-always-dynamically-allocate-buffer-for-kernel-mod.patch b/net/rtpengine/patches/07-always-dynamically-allocate-buffer-for-kernel-mod.patch new file mode 100644 index 0000000..6f42c17 --- /dev/null +++ b/net/rtpengine/patches/07-always-dynamically-allocate-buffer-for-kernel-mod.patch @@ -0,0 +1,36 @@ +--- a/kernel-module/xt_RTPENGINE.c ++++ b/kernel-module/xt_RTPENGINE.c +@@ -3455,14 +3455,11 @@ static inline ssize_t proc_control_read_ + struct inode *inode; + uint32_t id; + struct rtpengine_table *t; +- struct rtpengine_message msgbuf; + struct rtpengine_message *msg; + int err; + + if (buflen < sizeof(*msg)) + return -EIO; +- if (buflen == sizeof(*msg)) +- msg = &msgbuf; + else { /* > */ + msg = kmalloc(buflen, GFP_KERNEL); + if (!msg) +@@ -3559,16 +3556,14 @@ static inline ssize_t proc_control_read_ + goto out; + } + +- if (msg != &msgbuf) +- kfree(msg); ++ kfree(msg); + + return buflen; + + err: + table_put(t); + out: +- if (msg != &msgbuf) +- kfree(msg); ++ kfree(msg); + return err; + } + static ssize_t proc_control_write(struct file *file, const char __user *ubuf, size_t buflen, loff_t *off) {