Commit fa2012d3 authored by Stephane Grosjean's avatar Stephane Grosjean Committed by Ben Hutchings
Browse files

can: peak_usb: fix a potential out-of-sync while decoding packets



commit de280f40 upstream.

When decoding a buffer received from PCAN-USB, the first timestamp read in
a packet is a 16-bit coded time base, and the next ones are an 8-bit
offset to this base, regardless of the type of packet read.

This patch corrects a potential loss of synchronization by using a
timestamp index read from the buffer, rather than an index of received
data packets, to determine on the sizeof the timestamp to be read from the
packet being decoded.

Signed-off-by: default avatarStephane Grosjean <s.grosjean@peak-system.com>
Fixes: 46be265d ("can: usb: PEAK-System Technik PCAN-USB specific part")
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 4e5001f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment