mirror of https://gitee.com/openkylin/linux.git
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:
parent
8e3c595214
commit
c3ac54a6f5
|
@ -143,7 +143,7 @@ static ssize_t mbox_test_message_read(struct file *filp, char __user *userbuf,
|
||||||
int l = 0;
|
int l = 0;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
touser = kzalloc(MBOX_HEXDUMP_MAX_LEN, GFP_KERNEL);
|
touser = kzalloc(MBOX_HEXDUMP_MAX_LEN + 1, GFP_KERNEL);
|
||||||
if (!touser)
|
if (!touser)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue