hw/net/can/ctucan_core: Use stl_le_p to write to tx_buffers
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 10 Nov 2020 21:52:50 +0000 (22:52 +0100)
committerJason Wang <jasowang@redhat.com>
Wed, 11 Nov 2020 12:34:36 +0000 (20:34 +0800)
commit71182187ddae5d5b17bd48464f719798321484ed
tree1f14c3a4fdbfcbb84a670d6bab9031aa2144f9d3
parent676ea985c0d13c9d39b9ead4c60005abb9ea4218
hw/net/can/ctucan_core: Use stl_le_p to write to tx_buffers

Instead of casting an address within a uint8_t array to a
uint32_t*, use stl_le_p(). This handles possibly misaligned
addresses which would otherwise crash on some hosts.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Tested-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/can/ctucan_core.c