Skip to content

Commit 12c80eb

Browse files
str4t0mgalak
authored andcommitted
drivers: can: init timing.sjw also in canfd mode
This commit resolves the undefined behviour caused by missing timing.sjw initialization. Signed-off-by: Thomas Stranger <[email protected]>
1 parent 2b2a2ca commit 12c80eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/can/can_mcan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,11 @@ int can_mcan_init(const struct device *dev, const struct can_mcan_config *cfg,
343343
}
344344
#endif
345345

346+
timing.sjw = cfg->sjw;
346347
#ifdef CONFIG_CAN_FD_MODE
347348
timing_data.sjw = cfg->sjw_data;
348349
can_mcan_configure_timing(can, &timing, &timing_data);
349350
#else
350-
timing.sjw = cfg->sjw;
351351
can_mcan_configure_timing(can, &timing, NULL);
352352
#endif
353353

0 commit comments

Comments
 (0)