rpmsg: ns callback: correct the size of RPMsg service name

The RPMsg service name size is not equal to the size of the
RPMsg name service message. Correct the size when copying the
service name to local variable.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
This commit is contained in:
Wendy Liang
2018-07-30 13:19:50 -07:00
committed by wjliang
parent 675f880f76
commit 7499bdf78f

View File

@@ -469,9 +469,12 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
(void)src;
ns_msg = (struct rpmsg_ns_msg *)data;
if (len != sizeof(*ns_msg))
/* Returns as the message is corrupted */
return RPMSG_SUCCESS;
metal_io_block_read(io,
metal_io_virt_to_offset(io, ns_msg->name),
&name, len);
&name, sizeof(name));
dest = ns_msg->addr;
/* check if a Ept has been locally registered */