[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1293296117-27624-6-git-send-email-mkl@pengutronix.de>
Date: Sat, 25 Dec 2010 17:55:13 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: netdev@...r.kernel.org
Cc: socketcan-core@...ts.berlios.de,
Marc Kleine-Budde <mkl@...gutronix.de>,
Christian Pellegrin <chripell@...e.org>
Subject: [PATCH v2 5/9] can: mcp251x: don't copy data to rx'ed RTR frames
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: Christian Pellegrin <chripell@...e.org>
Acked-by: Wolfgang Grandegger <wg@...ndegger.com>
---
drivers/net/can/mcp251x.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 7ab534a..9e08acc 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -481,7 +481,8 @@ static void mcp251x_hw_rx(struct spi_device *spi, int buf_idx)
}
/* Data length */
frame->can_dlc = get_can_dlc(buf[RXBDLC_OFF] & RXBDLC_LEN_MASK);
- memcpy(frame->data, buf + RXBDAT_OFF, frame->can_dlc);
+ if (!(frame->can_id & CAN_RTR_FLAG))
+ memcpy(frame->data, buf + RXBDAT_OFF, frame->can_dlc);
priv->net->stats.rx_packets++;
priv->net->stats.rx_bytes += frame->can_dlc;
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists