be2net: Free/delete pmacs (in be_clear()) only if they exist
authorSomnath Kotur <somnath.kotur@emulex.com>
Thu, 5 Dec 2013 06:38:16 +0000 (12:08 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Dec 2013 20:03:40 +0000 (15:03 -0500)
commitb05004adf9d34e7fb8e96fe6a7cdeb0843f5ab35
tree95a9a5f6e67ae6361f16f88297348c9874578231
parent4bebb56a6d50ca50a34048194877dca34f572f8f
be2net: Free/delete pmacs (in be_clear()) only if they exist

During suspend-resume and lancer error recovery we will cleanup and
re-initialize the resources through be_clear() and be_setup() respectively.
During re-initialisation in be_setup(), if be_get_config() fails, we'll again
call be_clear() which will cause a NULL pointer dereference as adapter->pmac_id is
already freed.

Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c