diff options
author | Kurt Van Dijck <kurt.van.dijck@eia.be> | 2011-05-02 04:50:48 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-05 18:02:22 (GMT) |
commit | 87e9af6cc67d842cd92b52b81f3f14e665e7ab05 (patch) | |
tree | 965631795b4d21356a8d9a1935000fe9361c6ec5 /drivers/net/can/sja1000 | |
parent | 75bd0cbdc21d80859c80bdd5dd00125c1a3ccbca (diff) | |
download | linux-fsl-qoriq-87e9af6cc67d842cd92b52b81f3f14e665e7ab05.tar.xz |
can: fix SJA1000 dlc for RTR packets
RTR frames do have a valid data length code on CAN.
The driver for SJA1000 did not handle that situation properly.
Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/sja1000')
-rw-r--r-- | drivers/net/can/sja1000/sja1000.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c index a358ea9..f501bba 100644 --- a/drivers/net/can/sja1000/sja1000.c +++ b/drivers/net/can/sja1000/sja1000.c @@ -346,10 +346,10 @@ static void sja1000_rx(struct net_device *dev) | (priv->read_reg(priv, REG_ID2) >> 5); } + cf->can_dlc = get_can_dlc(fi & 0x0F); if (fi & FI_RTR) { id |= CAN_RTR_FLAG; } else { - cf->can_dlc = get_can_dlc(fi & 0x0F); for (i = 0; i < cf->can_dlc; i++) cf->data[i] = priv->read_reg(priv, dreg++); } |