mailbox: Off by one in mbox_test_message_read()

We need to leave space for the NUL char.

Fixes: 8ea4484d0c ('mailbox: Add generic mechanism for testing Mailbox Controllers')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
This commit is contained in:
Dan Carpenter 2015-10-22 22:51:27 +03:00 committed by Jassi Brar
parent 8e3c595214
commit c3ac54a6f5
1 changed files with 1 additions and 1 deletions

View File

@ -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;