]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: airoha: Add size check for TX NAPIs in airoha_qdma_cleanup()
authorLorenzo Bianconi <lorenzo@kernel.org>
Mon, 20 Apr 2026 08:07:48 +0000 (10:07 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 23 Apr 2026 10:17:35 +0000 (12:17 +0200)
commit4b91cb65789b794bfc8d50554b8994f8e0f16309
treea27a7fa988636a3245a54e601c6f977b886f09d4
parent379050947a1828826ad7ea50c95245a56929b35a
net: airoha: Add size check for TX NAPIs in airoha_qdma_cleanup()

If airoha_qdma_init routine fails before airoha_qdma_tx_irq_init() runs
successfully for all TX NAPIs, airoha_qdma_cleanup() will
unconditionally runs netif_napi_del() on TX NAPIs, triggering a NULL
pointer dereference. Fix the issue relying on q_tx_irq size value to
check if the TX NAPIs is properly initialized in airoha_qdma_cleanup().
Moreover, run netif_napi_add_tx() just if irq_q queue is properly
allocated.

Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260420-airoha_qdma_init_rx_queue-fix-v2-2-d99347e5c18d@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/airoha/airoha_eth.c