From: Stefan Günther When the device reports error counters, the driver incorrectly uses an assignment (=) instead of a bitwise OR (|=) for CAN_ERR_CNT. This wipes out the CAN_ERR_FLAG and CAN_ERR_CRTL flags, causing the error frame to be sent to userspace as a regular CAN frame with ID 0x200. Fix this by using a bitwise OR to preserve the flags. Signed-off-by: Stefan Günther Link: https://patch.msgid.link/20260915134551.54038-1-stefangun@pm.me Cc: stable@vger.kernel.org Fixes: 3e5c291c7942 ("can: add CAN_ERR_CNT flag to notify availability of error counter") Signed-off-by: Marc Kleine-Budde --- drivers/net/can/usb/peak_usb/pcan_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c index 8fd058c32856..785224e00c4e 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c @@ -526,7 +526,7 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n, /* Supply TX/RX error counters in case of * controller error. */ - cf->can_id = CAN_ERR_CNT; + cf->can_id |= CAN_ERR_CNT; cf->data[6] = mc->pdev->bec.txerr; cf->data[7] = mc->pdev->bec.rxerr; } -- 2.53.0