mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
This commit fixes a memory alignment issue in the rpmsg subsystem. The previous implementation used a flexible array member (rdev[0]) in struct rpmsg_s, but due to automatic 8-byte padding, rpmsg->rdev could differ from the transport layer's rdev address (e.g., rpmsg_virtio->rvdev.rdev), causing potential memory corruption. Changes: - Remove rdev[0] flexible array member from struct rpmsg_s - Add rpmsg_get_rdev_by_rpmsg() inline helper to calculate rdev address as (rpmsg + 1), ensuring correct pointer arithmetic - Update all rpmsg->rdev references to use the new helper function - Fix rpmsg_virtio_notify_wait() to use correct container_of macro Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Make.defs | ||
| rpmsg.c | ||
| rpmsg_ping.c | ||
| rpmsg_ping.h | ||
| rpmsg_port.c | ||
| rpmsg_port.h | ||
| rpmsg_port_spi.c | ||
| rpmsg_port_spi_slave.c | ||
| rpmsg_port_uart.c | ||
| rpmsg_router.h | ||
| rpmsg_router_edge.c | ||
| rpmsg_router_hub.c | ||
| rpmsg_test.c | ||
| rpmsg_test.h | ||
| rpmsg_virtio.c | ||
| rpmsg_virtio_ivshmem.c | ||
| rpmsg_virtio_lite.c | ||