be2net: protect eqo->affinity_mask from getting freed twice
authorKalesh AP <kalesh.purayil@avagotech.com>
Wed, 5 Aug 2015 07:27:50 +0000 (03:27 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Aug 2015 18:53:06 +0000 (11:53 -0700)
There are paths in the driver such as an unrecoverable error (UE) detection
followed by a driver unload wherein be_clear() is invoked twice.
Individual data structures are reset so that they are not cleaned/freed
twice. This patch does the same for eqo->affinity_mask. It is freed only
if EQs haven't yet been destroyed. This fixes a possible crash when
affinity_mask is freed twice.

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