Commit 6ea45886 authored by Olivier Sobrie's avatar Olivier Sobrie Committed by Marc Kleine-Budde

can: c_can: fix invalid error codes

Errors in CAN protocol (location) are reported in data[3] of the can
frame instead of data[2].

Cc: linux-stable <stable@vger.kernel.org>
Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: default avatarOlivier Sobrie <olivier@sobrie.be>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 5d0feaff
...@@ -960,7 +960,7 @@ static int c_can_handle_bus_err(struct net_device *dev, ...@@ -960,7 +960,7 @@ static int c_can_handle_bus_err(struct net_device *dev,
break; break;
case LEC_ACK_ERROR: case LEC_ACK_ERROR:
netdev_dbg(dev, "ack error\n"); netdev_dbg(dev, "ack error\n");
cf->data[2] |= (CAN_ERR_PROT_LOC_ACK | cf->data[3] |= (CAN_ERR_PROT_LOC_ACK |
CAN_ERR_PROT_LOC_ACK_DEL); CAN_ERR_PROT_LOC_ACK_DEL);
break; break;
case LEC_BIT1_ERROR: case LEC_BIT1_ERROR:
...@@ -973,7 +973,7 @@ static int c_can_handle_bus_err(struct net_device *dev, ...@@ -973,7 +973,7 @@ static int c_can_handle_bus_err(struct net_device *dev,
break; break;
case LEC_CRC_ERROR: case LEC_CRC_ERROR:
netdev_dbg(dev, "CRC error\n"); netdev_dbg(dev, "CRC error\n");
cf->data[2] |= (CAN_ERR_PROT_LOC_CRC_SEQ | cf->data[3] |= (CAN_ERR_PROT_LOC_CRC_SEQ |
CAN_ERR_PROT_LOC_CRC_DEL); CAN_ERR_PROT_LOC_CRC_DEL);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment