Skip to content

Commit 3c325ce

Browse files
jbrandebdavem330
authored andcommitted
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>
1 parent a3314f3 commit 3c325ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct(
354354
struct rtnl_link_stats64 *vsi_stats = i40e_get_vsi_stats_struct(vsi);
355355
int i;
356356

357+
if (!vsi->tx_rings)
358+
return stats;
359+
357360
rcu_read_lock();
358361
for (i = 0; i < vsi->num_queue_pairs; i++) {
359362
struct i40e_ring *tx_ring, *rx_ring;

0 commit comments

Comments
 (0)