]> git.itanic.dy.fi Git - linux-stable/commit
can: bittiming: can_sjw_check(): check that SJW is not longer than either Phase Buffe...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 6 Sep 2022 17:15:28 +0000 (19:15 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 6 Feb 2023 12:57:27 +0000 (13:57 +0100)
commitb5a3d0864ee7e43a6ef8a2820f901d60bf4e0703
treee466af4ad4741a56f24478f4576a76984100f153
parent0c017f0910a7f4d90708df853b629f487c8ba739
can: bittiming: can_sjw_check(): check that SJW is not longer than either Phase Buffer Segment

According to "The Configuration of the CAN Bit Timing" [1] the SJW
"may not be longer than either Phase Buffer Segment".

Check SJW against length of both Phase buffers. In case the SJW is
greater, report an error via netlink to user space and bail out.

[1] http://web.archive.org/http://www.oertel-halle.de/files/cia99paper.pdf

Link: https://lore.kernel.org/all/20230202110854.2318594-14-mkl@pengutronix.de
Suggested-by: Vincent Mailhol <vincent.mailhol@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev/bittiming.c