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>
This commit is contained in:

committed by
Marc Kleine-Budde

parent
7cecd9ab80
commit
ffd461f80d
@@ -402,8 +402,7 @@ static void usb_8dev_rx_err_msg(struct usb_8dev_priv *priv,
|
||||
break;
|
||||
case USB_8DEV_STATUSMSG_CRC:
|
||||
cf->data[2] |= CAN_ERR_PROT_UNSPEC;
|
||||
cf->data[3] |= CAN_ERR_PROT_LOC_CRC_SEQ |
|
||||
CAN_ERR_PROT_LOC_CRC_DEL;
|
||||
cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
|
||||
rx_errors = 1;
|
||||
break;
|
||||
case USB_8DEV_STATUSMSG_BIT0:
|
||||
|
Reference in New Issue
Block a user