]> git.baikalelectronics.ru Git - kernel.git/commit
be2net: Fix invocation of be_close() after be_clear()
authorKalesh AP <kalesh.purayil@emulex.com>
Mon, 14 Apr 2014 10:42:41 +0000 (16:12 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Apr 2014 17:41:37 +0000 (13:41 -0400)
commit111d5d4904f8b8887670fa9b7ef1c0b66e8dce59
tree37889e4b5e71892beadcd3fcff25da9033d81c3a
parent92fe19fb81c8c6a31dae47ce462b4075b52b5c60
be2net: Fix invocation of be_close() after be_clear()

In the EEH error recovery path, when a permanent failure occurs,
we clean up adapter structure (i.e. destroy queues etc) by calling
be_clear() and return PCI_ERS_RESULT_DISCONNECT.
After this the stack tries to remove device from bus and calls
be_remove() which invokes netdev_unregister()->be_close().
be_close() operating on destroyed queues results in a
NULL dereference.

This patch fixes this problem by introducing a flag to keep track
of the setup state.

Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be.h
drivers/net/ethernet/emulex/benet/be_main.c