Skip to contentSkip to conversation

ionic: Fix an error code in ionic_lif_alloc()

PATCH Applied Dan Carpenter 3 participants 3 messages Sep 21, 2019 – Sep 22, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ionic: Fix an error code in ionic_lif_alloc()

We need to set the error code on this path. Otherwise it probably results in a NULL dereference down the line.

Fixes aa3198819bea ("ionic: Add RSS support")
---
 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/pensando/ionic/ionic_lif.c +1 -0
index db7c82742828..72107a0627a9 100644
@@ -1704,6 +1704,7 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index
 					      GFP_KERNEL);
 
 	if (!lif->rss_ind_tbl) {
+		err = -ENOMEM;
 		dev_err(dev, "Failed to allocate rss indirection table, aborting\n");
 		goto err_out_free_qcqs;
 	}
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Dan Carpenter

We need to set the error code on this path. Otherwise it probably results in a NULL dereference down the line.

Fixes aa3198819bea ("ionic: Add RSS support")
---
  drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 +
  1 file changed, 1 insertion(+)
drivers/net/ethernet/pensando/ionic/ionic_lif.c +0 -0
index db7c82742828..72107a0627a9 100644

drivers/net/ethernet/pensando/ionic/ionic_lif.c static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index · line 1710

Quoted 7 lines
drivers/net/ethernet/pensando/ionic/ionic_lif.c +1 -0
@@ -1704,6 +1704,7 @@ static struct ionic_lif *ionic_lif_alloc(struct ionic *ionic, unsigned int index
  					      GFP_KERNEL);
 
  	if (!lif->rss_ind_tbl) {
+		err = -ENOMEM;
  		dev_err(dev, "Failed to allocate rss indirection table, aborting\n");
  		goto err_out_free_qcqs;
  	}

Thanks, Dan.