Files
telephony/net/rtpengine/patches/07-always-dynamically-allocate-buffer-for-kernel-mod.patch
Christian Marangi a5c29c23f0 rtpengine: bump to 11.5.1.49
Bump rtengine package to 11.5.1.49. This is needed to fix compilation
error on new kernel 6.12 that added a new scope variable to
ip_route_output.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-20 12:03:58 +01:00

47 lines
1.1 KiB
Diff

--- a/kernel-module/xt_RTPENGINE.c
+++ b/kernel-module/xt_RTPENGINE.c
@@ -3786,7 +3786,6 @@ static inline ssize_t proc_control_read_
struct rtpengine_table *t;
int err;
enum rtpengine_command cmd;
- char scratchbuf[512];
size_t readlen, writelen, writeoffset;
int i;
@@ -3828,13 +3827,9 @@ static inline ssize_t proc_control_read_
return -ERANGE;
// do we need an extra large storage buffer?
- if (buflen > sizeof(scratchbuf)) {
- msg.storage = kmalloc(buflen, GFP_KERNEL);
- if (!msg.storage)
- return -ENOMEM;
- }
- else
- msg.storage = scratchbuf;
+ msg.storage = kmalloc(buflen, GFP_KERNEL);
+ if (!msg.storage)
+ return -ENOMEM;
// get our table
inode = file->f_path.dentry->d_inode;
@@ -3947,16 +3942,14 @@ static inline ssize_t proc_control_read_
goto err_free;
}
- if (msg.storage != scratchbuf)
- kfree(msg.storage);
+ kfree(msg.storage);
return buflen;
err_table_free:
table_put(t);
err_free:
- if (msg.storage != scratchbuf)
- kfree(msg.storage);
+ kfree(msg.storage);
return err;
}
static ssize_t proc_control_write(struct file *file, const char __user *ubuf, size_t buflen, loff_t *off) {