Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
--- a/src/vectoring/ifxmips_vectoring.c
|
||||
+++ b/src/vectoring/ifxmips_vectoring.c
|
||||
@@ -300,7 +300,7 @@ static int proc_write_dbg(struct file *f
|
||||
DBG_ENABLE_MASK_ALL
|
||||
};
|
||||
|
||||
- char str[2048];
|
||||
+ char *str;
|
||||
char *p;
|
||||
|
||||
int len, rlen;
|
||||
@@ -308,6 +308,10 @@ static int proc_write_dbg(struct file *f
|
||||
int f_enable = 0;
|
||||
int i;
|
||||
|
||||
+ str = kcalloc(2048, sizeof(*str), GFP_KERNEL);
|
||||
+ if (!str)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
len = count < sizeof(str) ? count : sizeof(str) - 1;
|
||||
rlen = len - copy_from_user(str, buf, len);
|
||||
while ( rlen && str[rlen - 1] <= ' ' )
|
||||
@@ -367,6 +371,8 @@ static int proc_write_dbg(struct file *f
|
||||
}
|
||||
}
|
||||
|
||||
+ kfree(str);
|
||||
+
|
||||
return count;
|
||||
}
|
||||
|
||||
--- a/src/vectoring/ifxmips_vectoring_test.c
|
||||
+++ b/src/vectoring/ifxmips_vectoring_test.c
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
+#include <linux/slab.h>
|
||||
|
||||
#include "ifxmips_vectoring_stub.h"
|
||||
|
||||
@@ -46,13 +47,17 @@ static int proc_write_vectoring(struct f
|
||||
{
|
||||
char *p;
|
||||
int len;
|
||||
- char local_buf[1024];
|
||||
+ char *local_buf;
|
||||
|
||||
unsigned long pkt_len;
|
||||
int ret;
|
||||
unsigned long sys_flag;
|
||||
unsigned long start, end;
|
||||
|
||||
+ local_buf = kcalloc(1024, sizeof(*local_buf), GFP_KERNEL);
|
||||
+ if (!local_buf)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
len = sizeof(local_buf) < count ? sizeof(local_buf) - 1 : count;
|
||||
len = len - copy_from_user(local_buf, buf, len);
|
||||
local_buf[len] = 0;
|
||||
@@ -81,6 +86,8 @@ static int proc_write_vectoring(struct f
|
||||
else
|
||||
printk("echo send <size> > /proc/driver/vectoring_test\n");
|
||||
|
||||
+ kfree(local_buf);
|
||||
+
|
||||
return count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user