Skip to content

Commit 1f1a5e7

Browse files
stm-at-esdgregkh
authored andcommitted
can: usb: esd_usb2: esd_usb2_rx_event(): fix the interchange of the CAN RX and TX error counters
commit 044012b52029204900af9e4230263418427f4ba4 upstream. This patch fixes the interchanged fetch of the CAN RX and TX error counters from the ESD_EV_CAN_ERROR_EXT message. The RX error counter is really in struct rx_msg::data[2] and the TX error counter is in struct rx_msg::data[3]. Fixes: 96d8e90 ("can: Add driver for esd CAN-USB/2 device") Link: https://lore.kernel.org/r/20210825215227.4947-2-stefan.maetje@esd.eu Cc: stable@vger.kernel.org Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2f1a469 commit 1f1a5e7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/can/usb/esd_usb2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
236236
if (id == ESD_EV_CAN_ERROR_EXT) {
237237
u8 state = msg->msg.rx.data[0];
238238
u8 ecc = msg->msg.rx.data[1];
239-
u8 txerr = msg->msg.rx.data[2];
240-
u8 rxerr = msg->msg.rx.data[3];
239+
u8 rxerr = msg->msg.rx.data[2];
240+
u8 txerr = msg->msg.rx.data[3];
241241

242242
skb = alloc_can_err_skb(priv->netdev, &cf);
243243
if (skb == NULL) {

0 commit comments

Comments
 (0)