diff mbox series

[net] ionic: Fix an error code in ionic_lif_alloc()

Message ID 20190921055926.GA18726@mwanda
State Accepted
Delegated to: David Miller
Headers show
Series [net] ionic: Fix an error code in ionic_lif_alloc() | expand

Commit Message

Dan Carpenter Sept. 21, 2019, 5:59 a.m. UTC
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>
---
 drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Shannon Nelson Sept. 22, 2019, 6:21 p.m. UTC | #1
On 9/20/19 10:59 PM, Dan Carpenter wrote:
> 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>
> ---
>   drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> index db7c82742828..72107a0627a9 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
> @@ -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.

Acked-by: Shannon Nelson <snelson@pensando.io>
Jakub Kicinski Sept. 22, 2019, 9:17 p.m. UTC | #2
On Sat, 21 Sep 2019 08:59:26 +0300, Dan Carpenter wrote:
> 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>

Applied, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
index db7c82742828..72107a0627a9 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c
@@ -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;
 	}