telephony/net/rtpengine/patches/07-always-dynamically-allocate-buffer-for-kernel-mod.patch
Christian Marangi ed8d330504
rtpengine: bump to 11.5.1.12 release and set PCRE2
Bump rtpengine to release 11.5.1.12.

New 11.x release require libopus as a new library and also moved to
PCRE2 library.

Refresh patches and also introduce a new one to disable docs as they
changed doc generation tool and now would require a new prereq and docs
are not useful and would waste space on an embedded scenario.

For recording module libcurl is also now required.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-03 15:47:59 +01:00

46 lines
1.1 KiB
Diff

--- a/kernel-module/xt_RTPENGINE.c
+++ b/kernel-module/xt_RTPENGINE.c
@@ -3781,7 +3781,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;
@@ -3823,13 +3822,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;
@@ -3942,16 +3937,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) {