]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
can: ctucanfd: mark error-active controller status valid
authorAvi Weiss <thnkslprpt@gmail.com>
Thu, 23 Jul 2026 15:55:43 +0000 (18:55 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 29 Jul 2026 09:26:44 +0000 (11:26 +0200)
In the CAN_STATE_ERROR_ACTIVE case, cf->data[1] is set to
CAN_ERR_CRTL_ACTIVE, but cf->can_id is not set with CAN_ERR_CRTL in
that path.

Set CAN_ERR_CRTL so consumers know the controller-status information
in cf->data[1] is valid.

Fixes: 9bd24927e3ee ("can: ctucanfd: handle skb allocation failure")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
Link: https://patch.msgid.link/20260723155543.318414-1-thnkslprpt@gmail.com
Cc: stable@kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/ctucanfd/ctucanfd_base.c

index 0ea1ff28dfce8b55e959a3118e877f7670561d46..8f8b1c097ec6d26f10a3413084934348343b59d8 100644 (file)
@@ -869,7 +869,7 @@ static void ctucan_err_interrupt(struct net_device *ndev, u32 isr)
                        break;
                case CAN_STATE_ERROR_ACTIVE:
                        if (skb) {
-                               cf->can_id |= CAN_ERR_CNT;
+                               cf->can_id |= CAN_ERR_CRTL | CAN_ERR_CNT;
                                cf->data[1] = CAN_ERR_CRTL_ACTIVE;
                                cf->data[6] = bec.txerr;
                                cf->data[7] = bec.rxerr;