can: esd_usb: Move mislocated storage of SJA1000_ECC_SEG bits in case of a bus error
authorFrank Jungclaus <frank.jungclaus@esd.eu>
Thu, 16 Feb 2023 19:04:48 +0000 (20:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:06 +0000 (09:33 +0100)
commit08d2f6779535a8b2c1f03ee43385d0b61192046a
tree51f06ae6b0e9d646482af01c5090c1b911cb8ece
parent026ba2f7760e06c348695242928f8129d8a1ee67
can: esd_usb: Move mislocated storage of SJA1000_ECC_SEG bits in case of a bus error

[ Upstream commit 118469f88180438ef43dee93d71f77c00e7b425d ]

Move the supply for cf->data[3] (bit stream position of CAN error), in
case of a bus- or protocol-error, outside of the "switch (ecc &
SJA1000_ECC_MASK){}"-statement, because this bit stream position is
independent of the error type.

Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device")
Signed-off-by: Frank Jungclaus <frank.jungclaus@esd.eu>
Link: https://lore.kernel.org/all/20230216190450.3901254-2-frank.jungclaus@esd.eu
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/usb/esd_usb.c