diff options
author | Kurt Van Dijck <kurt.van.dijck@eia.be> | 2011-05-02 04:50:48 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-21 15:13:14 -0700 |
commit | ce850224f5ead68a9773decd16dbb794c23bb44e (patch) | |
tree | 186aab1b5dc4caee8357c3d251adf6959885408b | |
parent | 4e239472b3bcbc83a4e3115dab5489168d8086fd (diff) | |
download | linux-stable-ce850224f5ead68a9773decd16dbb794c23bb44e.tar.gz linux-stable-ce850224f5ead68a9773decd16dbb794c23bb44e.tar.bz2 linux-stable-ce850224f5ead68a9773decd16dbb794c23bb44e.zip |
can: fix SJA1000 dlc for RTR packets
commit 87e9af6cc67d842cd92b52b81f3f14e665e7ab05 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 0a8de01d52f7..a616658868d1 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++); } |