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: NChristian Marangi <ansuelsmth@gmail.com>
上级 39ca113f
--- 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) {
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册