projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
889b77f
)
can: kvaser_usb: Don't send a RESET_CHIP for non-existing channels
author
Ahmed S. Darwish
<
[email protected]
>
Mon, 5 Jan 2015 17:57:13 +0000
(12:57 -0500)
committer
Marc Kleine-Budde
<
[email protected]
>
Thu, 15 Jan 2015 15:58:01 +0000
(16:58 +0100)
Recent Leaf firmware versions (>= 3.1.557) do not allow to send
commands for non-existing channels. If a command is sent for a
non-existing channel, the firmware crashes.
Reported-by: Christopher Storah <
[email protected]
>
Signed-off-by: Olivier Sobrie <
[email protected]
>
Signed-off-by: Ahmed S. Darwish <
[email protected]
>
Cc: linux-stable <
[email protected]
>
Signed-off-by: Marc Kleine-Budde <
[email protected]
>
drivers/net/can/usb/kvaser_usb.c
patch
|
blob
|
history
diff --git
a/drivers/net/can/usb/kvaser_usb.c
b/drivers/net/can/usb/kvaser_usb.c
index 9accc8272c274accbc856066eca45d198d403c11..cc7bfc0c0a7134cfeb54362ebf49b76364f5e13d 100644
(file)
--- a/
drivers/net/can/usb/kvaser_usb.c
+++ b/
drivers/net/can/usb/kvaser_usb.c
@@
-1503,6
+1503,10
@@
static int kvaser_usb_init_one(struct usb_interface *intf,
struct kvaser_usb_net_priv *priv;
int i, err;
+ err = kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, channel);
+ if (err)
+ return err;
+
netdev = alloc_candev(sizeof(*priv), MAX_TX_URBS);
if (!netdev) {
dev_err(&intf->dev, "Cannot alloc candev\n");
@@
-1607,9
+1611,6
@@
static int kvaser_usb_probe(struct usb_interface *intf,
usb_set_intfdata(intf, dev);
- for (i = 0; i < MAX_NET_DEVICES; i++)
- kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, i);
-
err = kvaser_usb_get_software_info(dev);
if (err) {
dev_err(&intf->dev,