i40evf: check rings before freeing resources
authorMitch Williams <mitch.a.williams@intel.com>
Thu, 19 Nov 2015 19:34:18 +0000 (11:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:38 +0000 (08:27 +0200)
commit0af31973b5fd298a52e9429751be5e4bade42a83
tree2d8e7291bbb9b8d91071fd93a9f3a46256771b78
parent796adc8527c3ce901bd813816ac0ec9ab212ee81
i40evf: check rings before freeing resources

[ Upstream commit fdb47ae87af537b24977a03bc69cfe1c5c55ca62 ]

If the driver gets unloaded during reset recovery, it's possible
that it will attempt to free resources when they're already free.

Add a check to make sure that the Tx and Rx rings actually exist
before dereferencing them to free resources.

Change-ID: I4d2b7e9ede49f634d421a4c5deaa5446bc755eee
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/i40evf/i40evf_main.c