Commit 1c363900 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

sfc: fix calling of free_irq with already free vector

If the sfc driver is in legacy interrupt mode (either explicitly by
using interrupt_mode module param or by falling back to it) it will
hit a warning at kernel/irq/manage.c because it will try to free an irq
which wasn't allocated by it in the first place because the MSI(X) irqs are
zero and it'll try to free them unconditionally. So fix it by checking if
we're in legacy mode and freeing the appropriate irqs.

CC: Zenghui Shi <zshi@redhat.com>
CC: Ben Hutchings <ben@decadent.org.uk>
CC: <linux-net-drivers@solarflare.com>
CC: Shradha Shah <sshah@solarflare.com>
CC: David S. Miller <davem@davemloft.net>

Fixes: 1899c111 ("sfc: Fix IRQ cleanup in case of a probe failure")
Reported-by: default avatarZenghui Shi <zshi@redhat.com>
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@redhat.com>
Acked-by: default avatarShradha Shah <sshah@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bbeb0ead
...@@ -156,13 +156,15 @@ void efx_nic_fini_interrupt(struct efx_nic *efx) ...@@ -156,13 +156,15 @@ void efx_nic_fini_interrupt(struct efx_nic *efx)
efx->net_dev->rx_cpu_rmap = NULL; efx->net_dev->rx_cpu_rmap = NULL;
#endif #endif
/* Disable MSI/MSI-X interrupts */ if (EFX_INT_MODE_USE_MSI(efx)) {
efx_for_each_channel(channel, efx) /* Disable MSI/MSI-X interrupts */
free_irq(channel->irq, &efx->msi_context[channel->channel]); efx_for_each_channel(channel, efx)
free_irq(channel->irq,
/* Disable legacy interrupt */ &efx->msi_context[channel->channel]);
if (efx->legacy_irq) } else {
/* Disable legacy interrupt */
free_irq(efx->legacy_irq, efx); free_irq(efx->legacy_irq, efx);
}
} }
/* Register dump */ /* Register dump */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment