[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250313-urban-bat-of-cubism-bf5a4a-mkl@pengutronix.de>
Date: Thu, 13 Mar 2025 08:12:06 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Chenyuan Yang <chenyuan0y@...il.com>
Cc: kernel@...gutronix.de, mailhol.vincent@...adoo.fr, heiko@...ech.de,
linux-can@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] can: rockchip: bail out if skb cannot be allocated
Hello Chenyuan Yang,
thanks for your contribution.
On 12.03.2025 20:15:05, Chenyuan Yang wrote:
> Add NULL pointer check in rkcanfd_handle_error_int() to
> bail out if skb cannot be allocated.
If the skb cannot be allocated, the cf is also NULL.
regards,
Marc
> This is similar to the commit f7f0adfe64de
> ("can: rockchip: rkcanfd_handle_rx_fifo_overflow_int(): bail out if skb cannot be allocated").
>
> Signed-off-by: Chenyuan Yang <chenyuan0y@...il.com>
> ---
> drivers/net/can/rockchip/rockchip_canfd-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
> index d9a937ba126c..90395cbdaab9 100644
> --- a/drivers/net/can/rockchip/rockchip_canfd-core.c
> +++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
> @@ -551,7 +551,7 @@ static int rkcanfd_handle_error_int(struct rkcanfd_priv *priv)
>
> rkcanfd_handle_error_int_reg_ec(priv, cf, reg_ec);
>
> - if (!cf)
> + if (!cf || !skb)
> return 0;
>
> err = can_rx_offload_queue_timestamp(&priv->offload, skb, timestamp);
> --
> 2.34.1
>
>
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists