sfc: fix calling of free_irq with already free vector
authorNikolay Aleksandrov <nikolay@redhat.com>
Fri, 9 May 2014 09:11:39 +0000 (11:11 +0200)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 May 2014 09:49:30 +0000 (11:49 +0200)
commitce37c23f8c394e6bd271557044cbbdd0d2f7b9c9
tree9578d3c6371585aa1ab9722a7df2fb5a5bccbfa3
parent951c8657d8c4bb80afa304e4f506cdcf40fc1b8f
sfc: fix calling of free_irq with already free vector

[ Upstream commit 1c3639005f48492e5f2d965779efd814e80f8b15 ]

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: 1899c111a535 ("sfc: Fix IRQ cleanup in case of a probe failure")
Reported-by: Zenghui Shi <zshi@redhat.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Shradha Shah <sshah@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/net/ethernet/sfc/nic.c