Answering myself after reading my own comment once more:
In fact the code fix seems to be correct but the commit comment was
completely wrong which lead to my answer ...
can_dlc can hold values from 0 .. 8.
The first 4 bytes are placed in data[0..3]. When we have more(!) than 4
bytes in can_dlc, the bytes 5..8 are placed in data[4..7].
The good thing was, that the current check was more conservative than
your suggestion so that we did not detect any data loss.
Please send a V2 patch with corrected commit message.
Thanks,
Oliver
ps.
From: "phu.luuan" <phu.lu...@nxp.com>
+ * Copyright 2017 NXP
A one-liner contribution like this tiny fix usually does not lead to an
attribution in the copyrights. Your contribution is already perfectly
recorded by the Signed-off-by tag.