lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 25 Dec 2010 17:55:10 +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>,
	Barry Song <21cnbao@...il.com>
Subject: [PATCH v2 2/9] can: bfin_can: don't copy data to rx'ed RTR frames

Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: Barry Song <21cnbao@...il.com>
Acked-by: Wolfgang Grandegger <wg@...ndegger.com>
---
 drivers/net/can/bfin_can.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/can/bfin_can.c b/drivers/net/can/bfin_can.c
index b6e890d..07222ca 100644
--- a/drivers/net/can/bfin_can.c
+++ b/drivers/net/can/bfin_can.c
@@ -306,18 +306,19 @@ static void bfin_can_rx(struct net_device *dev, u16 isrc)
 			     & 0x1ffc) >> 2;
 		obj = RECEIVE_STD_CHL;
 	}
-	if (bfin_read16(&reg->chl[obj].id1) & RTR)
-		cf->can_id |= CAN_RTR_FLAG;
 
 	/* get data length code */
 	cf->can_dlc = get_can_dlc(bfin_read16(&reg->chl[obj].dlc) & 0xF);
 
-	/* get payload */
-	for (i = 0; i < 8; i += 2) {
-		val = bfin_read16(&reg->chl[obj].data[i]);
-		cf->data[7 - i] = (7 - i) < cf->can_dlc ? val : 0;
-		cf->data[6 - i] = (6 - i) < cf->can_dlc ? (val >> 8) : 0;
-	}
+	if (bfin_read16(&reg->chl[obj].id1) & RTR)
+		cf->can_id |= CAN_RTR_FLAG;
+	else	/* get payload */
+		for (i = 0; i < 8; i += 2) {
+			val = bfin_read16(&reg->chl[obj].data[i]);
+			cf->data[7 - i] = (7 - i) < cf->can_dlc ? val : 0;
+			cf->data[6 - i] = (6 - i) < cf->can_dlc ?
+				(val >> 8) : 0;
+		}
 
 	netif_rx(skb);
 
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ