diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2013-12-14 12:26:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-15 04:59:41 +0100 |
commit | 3c325ced6aefa72d43a54e324df7562564c26f91 (patch) | |
tree | 40162d132d29d1620e817a4911ee483ea30f8527 /drivers | |
parent | xen-netback: fix gso_prefix check (diff) | |
download | linux-3c325ced6aefa72d43a54e324df7562564c26f91.tar.xz linux-3c325ced6aefa72d43a54e324df7562564c26f91.zip |
i40e: fix null dereference
If the vsi->tx_rings structure is NULL we don't want to panic.
Change-Id: Ic694f043701738c434e8ebe0caf0673f4410dc10
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index be15938ba213..12b0932204ba 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -354,6 +354,9 @@ static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct( struct rtnl_link_stats64 *vsi_stats = i40e_get_vsi_stats_struct(vsi); int i; + if (!vsi->tx_rings) + return stats; + rcu_read_lock(); for (i = 0; i < vsi->num_queue_pairs; i++) { struct i40e_ring *tx_ring, *rx_ring; |