<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- a/src/vectoring/ifxmips_vectoring.c
+++ b/src/vectoring/ifxmips_vectoring.c
@@ -298,7 +298,7 @@ static int proc_write_dbg(struct file *file, const char __user *buf, size_t coun
         DBG_ENABLE_MASK_ALL
     };
 
-    char str[2048];
+    char *str;
     char *p;
 
     int len, rlen;
@@ -306,6 +306,10 @@ static int proc_write_dbg(struct file *file, const char __user *buf, size_t coun
     int f_enable = 0;
     int i;
 
+    str = kcalloc(2048, sizeof(*str), GFP_KERNEL);
+    if (!str)
+        return -ENOMEM;
+
     len = count &lt; sizeof(str) ? count : sizeof(str) - 1;
     rlen = len - copy_from_user(str, buf, len);
     while ( rlen &amp;&amp; str[rlen - 1] &lt;= ' ' )
@@ -365,6 +369,8 @@ static int proc_write_dbg(struct file *file, const char __user *buf, size_t coun
         }
     }
 
+    kfree(str);
+
     return count;
 }
 
--- a/src/vectoring/ifxmips_vectoring_test.c
+++ b/src/vectoring/ifxmips_vectoring_test.c
@@ -3,6 +3,7 @@
 #include &lt;linux/module.h&gt;
 #include &lt;linux/proc_fs.h&gt;
 #include &lt;linux/seq_file.h&gt;
+#include &lt;linux/slab.h&gt;
 
 #include "ifxmips_vectoring_stub.h"
 
@@ -46,13 +47,17 @@ static int proc_write_vectoring(struct file *file, const char __user *buf, size_
 {
     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) &lt; 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 file *file, const char __user *buf, size_
     else
         printk("echo send &lt;size&gt; &gt; /proc/driver/vectoring_test\n");
 
+    kfree(local_buf);
+
     return count;
 }
 
</pre></body></html>