]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: ems_usb: ems_usb_rx_err(): fix {rx,tx}_errors statistics
authorDario Binacchi <dario.binacchi@amarulasolutions.com>
Fri, 22 Nov 2024 22:15:52 +0000 (23:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:26 +0000 (19:51 +0100)
commit6e2c9e417ef7bd800592f7880272ae8f2f8d3780
treedb9ec0a32be1585a1dfc82ad99cba1fe627cca46
parent1ed979b833df6226acd00b85c2cc1f851ca316e4
can: ems_usb: ems_usb_rx_err(): fix {rx,tx}_errors statistics

[ Upstream commit 72a7e2e74b3075959f05e622bae09b115957dffe ]

The ems_usb_rx_err() function only incremented the receive error counter
and never the transmit error counter, even if the ECC_DIR flag reported
that an error had occurred during transmission.

Increment the receive/transmit error counter based on the value of the
ECC_DIR flag.

Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://patch.msgid.link/20241122221650.633981-12-dario.binacchi@amarulasolutions.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/usb/ems_usb.c