Skip to content

Commit 8135961

Browse files
tititiou36davem330
authored andcommitted
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: 46a3df9 ("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>
1 parent 4792ea0 commit 8135961

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2652,7 +2652,8 @@ static int hclge_rss_init_hw(struct hclge_dev *hdev)
26522652
dev_err(&hdev->pdev->dev,
26532653
"Configure rss tc size failed, invalid TC_SIZE = %d\n",
26542654
rss_size);
2655-
return -EINVAL;
2655+
ret = -EINVAL;
2656+
goto err;
26562657
}
26572658

26582659
roundup_size = roundup_pow_of_two(rss_size);

0 commit comments

Comments
 (0)