Thread (1 message) 1 message, 1 author, 2013-07-03
  • (off-list ancestor, not in this archive)
  • Re: Usb to can driver · Marc Kleine-Budde <mkl@pengutronix.de> · 2013-07-03

Re: Usb to can driver

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2013-07-03 07:56:08

Possibly related (same subject, not in this thread)

On 07/03/2013 02:14 AM, Max S. wrote:
quoted
quoted
Can you send a patch? :)
sure. attached.
Thanks. Please the mailinglist for all linux can related patches.
However, since i don't have the hardware; I can't test this.
Me neither, but the patch looks good.
quoted hunk
From f6f2ec1b1c2fa4f2d29fb48e8a315ff814ed2be9 Mon Sep 17 00:00:00 2001
From: Maximilian Schneider <redacted>
Date: Tue, 2 Jul 2013 23:43:29 +0000
Subject: [PATCH] use of raw input in net lookup


Signed-off-by: Maximilian Schneider <redacted>
---
 drivers/net/can/usb/esd_usb2.c |    6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index 6aa7b32..ee89b19 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -412,10 +412,16 @@ static void esd_usb2_read_bulk_callback(struct urb *urb)
 
 		switch (msg->msg.hdr.cmd) {
 		case CMD_CAN_RX:
+			if (msg->msg.rx.net >= dev->net_count)
I've added an error message here.
+				break;
+
 			esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg);
 			break;
 
 		case CMD_CAN_TX:
+			if (msg->msg.txdone.net >= dev->net_count)
and here, too.
+				break;
+
 			esd_usb2_tx_done_msg(dev->nets[msg->msg.txdone.net],
 					     msg);
 			break;
-- 1.7.10.4
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help