From: John Jacques <john.jacq...@intel.com>

Memory allocation in axxia-oem.c was not allocating a byte
for the termination character.

Signed-off-by: John Jacques <john.jacq...@intel.com>
---
 drivers/misc/axxia-oem.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/axxia-oem.c b/drivers/misc/axxia-oem.c
index 0599242..e46ee71 100644
--- a/drivers/misc/axxia-oem.c
+++ b/drivers/misc/axxia-oem.c
@@ -92,7 +92,7 @@ axxia_dspc_write(struct file *file, const char __user *buffer,
        char *input;
        unsigned long mask;
 
-       input = kmalloc(count, __GFP_WAIT);
+       input = kmalloc(count + 1, __GFP_WAIT);
 
        if (NULL == input)
                return -ENOSPC;
@@ -146,7 +146,7 @@ axxia_actlr_el3_write(struct file *file, const char __user 
*buffer,
 {
        char *input;
 
-       input = kmalloc(count, __GFP_WAIT);
+       input = kmalloc(count + 1, __GFP_WAIT);
 
        if (NULL == input)
                return -ENOSPC;
@@ -199,7 +199,7 @@ axxia_actlr_el2_write(struct file *file, const char __user 
*buffer,
 {
        char *input;
 
-       input = kmalloc(count, __GFP_WAIT);
+       input = kmalloc(count + 1, __GFP_WAIT);
 
        if (NULL == input)
                return -ENOSPC;
@@ -255,7 +255,7 @@ axxia_ccn_offset_write(struct file *file, const char __user 
*buffer,
        char *input;
        unsigned int new_ccn_offset;
 
-       input = kmalloc(count, __GFP_WAIT);
+       input = kmalloc(count + 1, __GFP_WAIT);
 
        if (NULL == input)
                return -ENOSPC;
@@ -316,7 +316,7 @@ axxia_ccn_value_write(struct file *file, const char __user 
*buffer,
 {
        char *input;
 
-       input = kmalloc(count, __GFP_WAIT);
+       input = kmalloc(count + 1, __GFP_WAIT);
 
        if (NULL == input)
                return -ENOSPC;
-- 
2.7.4

-- 
_______________________________________________
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto

Reply via email to