ionic: Fix an error code in ionic_lif_alloc()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 21 Sep 2019 05:59:26 +0000 (08:59 +0300)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sun, 22 Sep 2019 21:16:15 +0000 (14:16 -0700)
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/ethernet/pensando/ionic/ionic_lif.c

index db7c82742828cf85de1d6fead0927aeff232864e..72107a0627a9957de0ce4c01e6b561f37599b510 100644 (file)
@@ -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;
        }