diff options
| author | Old-Ding <[email protected]> | 2026-07-06 10:45:04 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-07-08 14:02:42 +0800 |
| commit | 9e2ab35e173afe07785f3f2fb1a2fdad54cd47a6 (patch) | |
| tree | a03b2a7377660b60f8f6bbd84c6a3b997b02b04e /bsp | |
| parent | d2d89271ea794cb8d7fd900eb7246053ec7a7b94 (diff) | |
bsp: rockchip: Fix CAN-FD bit timing copy size
RT_CAN_CMD_SET_BITTIMING receives an array of struct rt_can_bit_timing entries. The Rockchip CAN-FD driver used sizeof(&timing->items[n]) when copying those entries, so only pointer-sized bytes were copied into the device configuration.
Use the element size so both arbitration and data phase timing structures are copied completely.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <[email protected]>
Diffstat (limited to 'bsp')
| -rwxr-xr-x | bsp/rockchip/dm/can/canfd-rockchip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bsp/rockchip/dm/can/canfd-rockchip.c b/bsp/rockchip/dm/can/canfd-rockchip.c index b8f72fc635..864517cc6c 100755 --- a/bsp/rockchip/dm/can/canfd-rockchip.c +++ b/bsp/rockchip/dm/can/canfd-rockchip.c @@ -534,13 +534,13 @@ static rt_err_t rockchip_canfd_control(struct rt_can_device *can, int cmd, void if (timing->count) { rt_memcpy(&can->config.can_timing, &timing->items[0], - sizeof(&timing->items[0])); + sizeof(timing->items[0])); } if (timing->count == 2) { rt_memcpy(&can->config.canfd_timing, &timing->items[1], - sizeof(&timing->items[1])); + sizeof(timing->items[1])); } break; |
