From ef77fe3402c95ea40c2ab376554737fe8796f526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Thu, 7 Sep 2023 12:03:16 +0200 Subject: [PATCH] tests: canbus: isotp: conformance: fix global variable usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Even though it was leading to the same result, the function should use its parameter and not the global variable for desired frames. Signed-off-by: Martin Jäger --- tests/subsys/canbus/isotp/conformance/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/subsys/canbus/isotp/conformance/src/main.c b/tests/subsys/canbus/isotp/conformance/src/main.c index e6510a25f06..64947ae0ed1 100644 --- a/tests/subsys/canbus/isotp/conformance/src/main.c +++ b/tests/subsys/canbus/isotp/conformance/src/main.c @@ -372,7 +372,7 @@ static void prepare_cf_frames(struct frame_desired *frames, size_t frames_cnt, for (i = 0; i < frames_cnt && remaining_length; i++) { frames[i].data[0] = CF_PCI_BYTE_1 | ((i+1) & 0x0F); frames[i].length = TX_DL; - memcpy(&des_frames[i].data[1], data_ptr, DATA_SIZE_CF); + memcpy(&frames[i].data[1], data_ptr, DATA_SIZE_CF); if (remaining_length < DATA_SIZE_CF) { if ((IS_ENABLED(CONFIG_ISOTP_ENABLE_TX_PADDING) && tx) || @@ -380,7 +380,7 @@ static void prepare_cf_frames(struct frame_desired *frames, size_t frames_cnt, uint8_t padded_dlc = can_bytes_to_dlc(MAX(8, remaining_length + 1)); uint8_t padded_len = can_dlc_to_bytes(padded_dlc); - memset(&des_frames[i].data[remaining_length + 1], 0xCC, + memset(&frames[i].data[remaining_length + 1], 0xCC, padded_len - remaining_length - 1); frames[i].length = padded_len; } else {