mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
can: flex_can: Correct the checking for frame length in flexcan_start_xmit()
[ Upstream commit 13454c1455 ]
The flexcan_start_xmit() function compares the frame length with data
register length to write frame content into data[0] and data[1]
register. Data register length is 4 bytes and frame maximum length is 8
bytes.
Fix the check that compares frame length with 3. Because the register
length is 4.
Signed-off-by: Luu An Phu <phu.luuan@nxp.com>
Reviewed-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0f258cc64f
commit
3f39cc7fe9
@@ -526,7 +526,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
data = be32_to_cpup((__be32 *)&cf->data[0]);
|
||||
flexcan_write(data, &priv->tx_mb->data[0]);
|
||||
}
|
||||
if (cf->can_dlc > 3) {
|
||||
if (cf->can_dlc > 4) {
|
||||
data = be32_to_cpup((__be32 *)&cf->data[4]);
|
||||
flexcan_write(data, &priv->tx_mb->data[1]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user