aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2017-09-30 01:34:34 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-02 01:57:24 -0400
commit81359617f1b783a01e6e22b46cbb046e9513b9c6 (patch)
treea362ce35fcdd1d33e5d12ac99b920a04fc1f1483
parent4792ea04bcd03b8ccfd1ae336c5deba52dd9edc9 (diff)
net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'
If this sanity check fails, we must free 'rss_indir'. Otherwise there is a memory leak. 'goto err' as done in the other error handling paths to fix it. Fixes: 46a3df9f9718 ("net: hns3: Fix for setting rss_size incorrectly") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index e0685e630afe..c1cdbfd83bdb 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -2652,7 +2652,8 @@ static int hclge_rss_init_hw(struct hclge_dev *hdev)
2652 dev_err(&hdev->pdev->dev, 2652 dev_err(&hdev->pdev->dev,
2653 "Configure rss tc size failed, invalid TC_SIZE = %d\n", 2653 "Configure rss tc size failed, invalid TC_SIZE = %d\n",
2654 rss_size); 2654 rss_size);
2655 return -EINVAL; 2655 ret = -EINVAL;
2656 goto err;
2656 } 2657 }
2657 2658
2658 roundup_size = roundup_pow_of_two(rss_size); 2659 roundup_size = roundup_pow_of_two(rss_size);