diff options
| author | Christian Marangi | 2023-05-12 17:41:14 +0000 |
|---|---|---|
| committer | Christian Marangi | 2023-05-12 17:42:31 +0000 |
| commit | f265a9399173dd9cf705c298652816e4fb948714 (patch) | |
| tree | f3e25996241832090aac737a8d3cd4a97a1bd90e | |
| parent | 39ca113f84f45dc366df5b4b98c116309bfbf92b (diff) | |
| download | telephony-f265a9399173dd9cf705c298652816e4fb948714.tar.gz | |
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 <ansuelsmth@gmail.com>
| -rw-r--r-- | net/rtpengine/patches/07-always-dynamically-allocate-buffer-for-kernel-mod.patch | 36 |
1 files changed, 36 insertions, 0 deletions
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) { |