]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: octeon: fix free_irq dev_id mismatch in cvm_oct_rx_shutdown
authorYuvraj Singh Chauhan <ysinghcin@gmail.com>
Thu, 12 Feb 2026 17:19:03 +0000 (22:49 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Feb 2026 14:42:20 +0000 (15:42 +0100)
In cvm_oct_rx_initialize(), request_irq() is called with
&oct_rx_group[i].napi as the dev_id:

request_irq(oct_rx_group[i].irq, cvm_oct_do_interrupt, 0, "Ethernet",
&oct_rx_group[i].napi);

However, cvm_oct_rx_shutdown() passes cvm_oct_device (an array of
struct net_device pointers) as the dev_id to free_irq():

  free_irq(oct_rx_group[i].irq, cvm_oct_device);

Since __free_irq() matches the action to remove by comparing
dev_id pointers, the mismatched cookie means the IRQ handler is
never found, triggering a WARN and leaving the IRQ line permanently
allocated. This prevents proper driver cleanup on module removal.

Fix the mismatch by passing &oct_rx_group[i].napi as the dev_id
to free_irq(), matching what was used during request_irq().

Signed-off-by: Yuvraj Singh Chauhan <ysinghcin@gmail.com>
Link: https://patch.msgid.link/20260212171903.1417804-1-ysinghcin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/octeon/ethernet-rx.c

index 965330eec80a8a027e495767cebe4e5314ca6cdc..d0b43d50b83ce113f4fc6a2ac828ad25a2282cf6 100644 (file)
@@ -535,7 +535,7 @@ void cvm_oct_rx_shutdown(void)
                        cvmx_write_csr(CVMX_POW_WQ_INT_THRX(i), 0);
 
                /* Free the interrupt handler */
-               free_irq(oct_rx_group[i].irq, cvm_oct_device);
+               free_irq(oct_rx_group[i].irq, &oct_rx_group[i].napi);
 
                netif_napi_del(&oct_rx_group[i].napi);
        }