Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29d0790e authored by Shannon Nelson's avatar Shannon Nelson Committed by Jeff Kirsher
Browse files

i40e: prevent null pointer exception in dump descriptor



Check that rings were allocated before trying to reference them.

Change-Id: I33151e55ab7a7a305fecdb88ccb2709ac246b7c7
Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3753cb24
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -782,6 +782,12 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
			dev_info(&pf->pdev->dev, "dump desc tx <vsi_seid> <ring_id> [<desc_n>]\n");
		return;
	}
	if (!vsi->tx_rings) {
		dev_info(&pf->pdev->dev,
			 "descriptor rings have not been allocated for vsi %d\n",
			 vsi_seid);
		return;
	}
	if (is_rx_ring)
		ring = *vsi->rx_rings[ring_id];
	else