Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742509 > unrolled thread

[PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-09-30 07:40 +0200
Last post2017-10-02 08:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-30 07:40 +0200
    Re: [PATCH] net: hns3: Fix an error handling path in  'hclge_rss_init_hw()' Yunsheng Lin <linyunsheng@huawei.com> - 2017-09-30 08:20 +0200
    Re: [PATCH] net: hns3: Fix an error handling path in  'hclge_rss_init_hw()' David Miller <davem@davemloft.net> - 2017-10-02 08:00 +0200

#1742509 — [PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-09-30 07:40 +0200
Subject[PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'
Message-ID<uviFj-8kJ-9@gated-at.bofh.it>
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>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)
 		dev_err(&hdev->pdev->dev,
 			"Configure rss tc size failed, invalid TC_SIZE = %d\n",
 			rss_size);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto err;
 	}
 
 	roundup_size = roundup_pow_of_two(rss_size);
-- 
2.11.0

[toc] | [next] | [standalone]


#1742524 — Re: [PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'

FromYunsheng Lin <linyunsheng@huawei.com>
Date2017-09-30 08:20 +0200
SubjectRe: [PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'
Message-ID<uvji3-nu-27@gated-at.bofh.it>
In reply to#1742509
Hi, Christophe

On 2017/9/30 13:34, Christophe JAILLET wrote:
> 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.

Thanks for fixing.

> 
> Fixes: 46a3df9f9718 ("net: hns3: Fix for setting rss_size incorrectly")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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)
>  		dev_err(&hdev->pdev->dev,
>  			"Configure rss tc size failed, invalid TC_SIZE = %d\n",
>  			rss_size);
> -		return -EINVAL;
> +		ret = -EINVAL;
> +		goto err;
>  	}
>  
>  	roundup_size = roundup_pow_of_two(rss_size);
> 

[toc] | [prev] | [next] | [standalone]


#1742970 — Re: [PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'

FromDavid Miller <davem@davemloft.net>
Date2017-10-02 08:00 +0200
SubjectRe: [PATCH] net: hns3: Fix an error handling path in 'hclge_rss_init_hw()'
Message-ID<uw1VM-3t7-5@gated-at.bofh.it>
In reply to#1742509
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Sat, 30 Sep 2017 07:34:34 +0200

> 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>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web