From: Shannon Nelson Date: Tue, 26 Nov 2013 10:49:26 +0000 (+0000) Subject: i40e: prevent null pointer exception in dump descriptor X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=29d0790ef3acd869bc392676a7623e5613ab33e8;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git i40e: prevent null pointer exception in dump descriptor Check that rings were allocated before trying to reference them. Change-Id: I33151e55ab7a7a305fecdb88ccb2709ac246b7c7 Signed-off-by: Shannon Nelson Signed-off-by: Jesse Brandeburg Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c index 18296f8fcb68..0ce0664de2ea 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c @@ -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 []\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