mirror of
https://github.com/OpenAMP/open-amp.git
synced 2026-02-06 02:54:32 +08:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user