summaryrefslogtreecommitdiff
path: root/drivers/mailbox/mailbox-test.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-10-22 22:51:27 +0300
committerJassi Brar <jaswinder.singh@linaro.org>2015-10-27 21:27:25 +0530
commitc3ac54a6f554475b034f87d471417bf0afcf3a42 (patch)
tree779c174f3e3a6d9430f6ad972703c8cf39103b63 /drivers/mailbox/mailbox-test.c
parent8e3c5952144f045a0c81bf674d3f5e1d9aafceb7 (diff)
mailbox: Off by one in mbox_test_message_read()
We need to leave space for the NUL char. Fixes: 8ea4484d0c2b ('mailbox: Add generic mechanism for testing Mailbox Controllers') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Diffstat (limited to 'drivers/mailbox/mailbox-test.c')
-rw-r--r--drivers/mailbox/mailbox-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index a4f10cc4aea3..f82dc8926687 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -143,7 +143,7 @@ static ssize_t mbox_test_message_read(struct file *filp, char __user *userbuf,
int l = 0;
int ret;
- touser = kzalloc(MBOX_HEXDUMP_MAX_LEN, GFP_KERNEL);
+ touser = kzalloc(MBOX_HEXDUMP_MAX_LEN + 1, GFP_KERNEL);
if (!touser)
return -ENOMEM;