diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2015-11-21 12:41:20 -0500 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-11-23 03:37:34 -0500 |
commit | ffd461f80d536336811d573f197f3e6d9872d054 (patch) | |
tree | 2bbab4a1de8d6f21b063f85648ddf68a6d21f88c /drivers/net/can/usb/usb_8dev.c | |
parent | 7cecd9ab80f43972c056dc068338f7bcc407b71c (diff) |
can: fix assignment of error location in CAN error messages
As Dan Carpenter reported in http://marc.info/?l=linux-can&m=144793696016187
the assignment of the error location in CAN error messages had some bit wise
overlaps. Indeed the value to be assigned in data[3] is no bitfield but defines
a single value which points to a location inside the CAN frame on the wire.
This patch fixes the assignments for the error locations in error messages.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/usb/usb_8dev.c')
-rw-r--r-- | drivers/net/can/usb/usb_8dev.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c index de95b1ccba3e..017ae5002169 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c | |||
@@ -402,8 +402,7 @@ static void usb_8dev_rx_err_msg(struct usb_8dev_priv *priv, | |||
402 | break; | 402 | break; |
403 | case USB_8DEV_STATUSMSG_CRC: | 403 | case USB_8DEV_STATUSMSG_CRC: |
404 | cf->data[2] |= CAN_ERR_PROT_UNSPEC; | 404 | cf->data[2] |= CAN_ERR_PROT_UNSPEC; |
405 | cf->data[3] |= CAN_ERR_PROT_LOC_CRC_SEQ | | 405 | cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ; |
406 | CAN_ERR_PROT_LOC_CRC_DEL; | ||
407 | rx_errors = 1; | 406 | rx_errors = 1; |
408 | break; | 407 | break; |
409 | case USB_8DEV_STATUSMSG_BIT0: | 408 | case USB_8DEV_STATUSMSG_BIT0: |