diff options
author | Peng Li <lipeng321@huawei.com> | 2017-12-22 12:21:43 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-27 10:40:39 -0500 |
commit | 99fdf6b1cadf41bb253408589788f025027274f3 (patch) | |
tree | 7a054c083ae7e67d717933c5ce64e104afa24191 /drivers/net/ethernet/hisilicon | |
parent | f0e98c97fa8f169952ca2c1187f9270902c1800d (diff) | |
download | linux-99fdf6b1cadf41bb253408589788f025027274f3.tar.bz2 |
net: hns3: free the ring_data structrue when change tqps
This patch fixes a memory leak problems in change tqps process,
the function hns3_uninit_all_ring and hns3_init_all_ring
may be called many times.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Mingguang Qu <qumingguang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 7e92068f2655..1c9303860531 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -2800,8 +2800,12 @@ int hns3_uninit_all_ring(struct hns3_nic_priv *priv) h->ae_algo->ops->reset_queue(h, i); hns3_fini_ring(priv->ring_data[i].ring); + devm_kfree(priv->dev, priv->ring_data[i].ring); hns3_fini_ring(priv->ring_data[i + h->kinfo.num_tqps].ring); + devm_kfree(priv->dev, + priv->ring_data[i + h->kinfo.num_tqps].ring); } + devm_kfree(priv->dev, priv->ring_data); return 0; } |