[PATCH v2 2/2] can: at91_can: add missing can_rx_offload_del() in at91_can_remove()

Ciprian Costea ciprianmarian.costea at oss.nxp.com
Tue Sep 1 01:39:27 PDT 2026


From: Ciprian Marian Costea <ciprianmarian.costea at oss.nxp.com>

at91_can_probe() sets up rx-offload via can_rx_offload_add_timestamp(),
but at91_can_remove() never calls can_rx_offload_del(). The NAPI
instance added by can_rx_offload_add_timestamp() is therefore never
removed on unbind.

This was benign while the offload's IRQ queue was embedded in struct
can_rx_offload, but it now leaks the per-CPU skb_irq_queue allocation.
Add the missing can_rx_offload_del() after unregister_netdev().

Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea at oss.nxp.com>
---
 drivers/net/can/at91_can.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 58da323f14d7..3ee908817add 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1165,6 +1165,8 @@ static void at91_can_remove(struct platform_device *pdev)
 
 	unregister_netdev(dev);
 
+	can_rx_offload_del(&priv->offload);
+
 	iounmap(priv->reg_base);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- 
2.43.0




More information about the linux-arm-kernel mailing list