]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: ctucanfd: handle skb allocation failure
authorFedor Pchelkin <pchelkin@ispras.ru>
Tue, 14 Jan 2025 15:21:38 +0000 (18:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:33 +0000 (14:01 +0100)
commitb0e592dd46a0a952b41c3bf6c963afdd6a42b526
treefdb5b812d5f3f3414100423a44cfe90294e4cf64
parentbd035e2758cc599281deab5e22f017ccc5cfa8b9
can: ctucanfd: handle skb allocation failure

commit 9bd24927e3eeb85642c7baa3b28be8bea6c2a078 upstream.

If skb allocation fails, the pointer to struct can_frame is NULL. This
is actually handled everywhere inside ctucan_err_interrupt() except for
the only place.

Add the missed NULL check.

Found by Linux Verification Center (linuxtesting.org) with SVACE static
analysis tool.

Fixes: 2dcb8e8782d8 ("can: ctucanfd: add support for CTU CAN FD open-source IP core - bus independent part.")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://patch.msgid.link/20250114152138.139580-1-pchelkin@ispras.ru
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/ctucanfd/ctucanfd_base.c