[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221027080629.mn6hhdg56d4achwl@pengutronix.de>
Date: Thu, 27 Oct 2022 10:06:29 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: linux-can@...r.kernel.org, netdev@...r.kernel.org,
robin@...tonic.nl, linux@...pel-privat.de, kernel@...gutronix.de,
socketcan@...tkopp.net
Subject: Re: [PATCH] can: j1939: transport: replace kfree_skb() with
dev_kfree_skb_irq()
On 26.10.2022 20:53:54, Yang Yingliang wrote:
> It is not allowed to call kfree_skb() from hardware interrupt
> context or with interrupts being disabled. So replace kfree_skb()
> with dev_kfree_skb_irq() under spin_lock_irqsave().
>
> Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
> ---
> net/can/j1939/transport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
> index d7d86c944d76..b95fb759c49d 100644
> --- a/net/can/j1939/transport.c
> +++ b/net/can/j1939/transport.c
> @@ -343,7 +343,7 @@ static void j1939_session_skb_drop_old(struct j1939_session *session)
> /* drop ref taken in j1939_session_skb_queue() */
> skb_unref(do_skb);
>
> - kfree_skb(do_skb);
> + dev_kfree_skb_irq(do_skb);
Can you call spin_unlock_irqrestore() before the kfree_skb()? Does that
fix the problem?
> }
> spin_unlock_irqrestore(&session->skb_queue.lock, flags);
> }
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists