]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
5ae44bddf99c9c47b8294a8cb805be6dae5da6b6
[thirdparty/kernel/stable-queue.git] /
1 From 044012b52029204900af9e4230263418427f4ba4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Stefan=20M=C3=A4tje?= <stefan.maetje@esd.eu>
3 Date: Wed, 25 Aug 2021 23:52:27 +0200
4 Subject: can: usb: esd_usb2: esd_usb2_rx_event(): fix the interchange of the CAN RX and TX error counters
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Stefan Mätje <stefan.maetje@esd.eu>
10
11 commit 044012b52029204900af9e4230263418427f4ba4 upstream.
12
13 This patch fixes the interchanged fetch of the CAN RX and TX error
14 counters from the ESD_EV_CAN_ERROR_EXT message. The RX error counter
15 is really in struct rx_msg::data[2] and the TX error counter is in
16 struct rx_msg::data[3].
17
18 Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device")
19 Link: https://lore.kernel.org/r/20210825215227.4947-2-stefan.maetje@esd.eu
20 Cc: stable@vger.kernel.org
21 Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
22 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 ---
25 drivers/net/can/usb/esd_usb2.c | 4 ++--
26 1 file changed, 2 insertions(+), 2 deletions(-)
27
28 --- a/drivers/net/can/usb/esd_usb2.c
29 +++ b/drivers/net/can/usb/esd_usb2.c
30 @@ -236,8 +236,8 @@ static void esd_usb2_rx_event(struct esd
31 if (id == ESD_EV_CAN_ERROR_EXT) {
32 u8 state = msg->msg.rx.data[0];
33 u8 ecc = msg->msg.rx.data[1];
34 - u8 txerr = msg->msg.rx.data[2];
35 - u8 rxerr = msg->msg.rx.data[3];
36 + u8 rxerr = msg->msg.rx.data[2];
37 + u8 txerr = msg->msg.rx.data[3];
38
39 skb = alloc_can_err_skb(priv->netdev, &cf);
40 if (skb == NULL) {