mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
net: hns3: free the ring_data structrue when change tqps
[ Upstream commit 99fdf6b1ca
]
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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
93b8f4a230
commit
f7b0ea2245
1 changed files with 4 additions and 0 deletions
|
@ -2687,8 +2687,12 @@ static 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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue