stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net: hns3: free the ring_data structrue when change tqps" has been added to the 4.15-stable tree
@ 2018-04-09  9:36 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-04-09  9:36 UTC (permalink / raw)
  To: lipeng321, alexander.levin, davem, gregkh, qumingguang
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    net: hns3: free the ring_data structrue when change tqps

to the 4.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-hns3-free-the-ring_data-structrue-when-change-tqps.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Mon Apr  9 10:16:32 CEST 2018
From: Peng Li <lipeng321@huawei.com>
Date: Fri, 22 Dec 2017 12:21:43 +0800
Subject: net: hns3: free the ring_data structrue when change tqps

From: Peng Li <lipeng321@huawei.com>


[ Upstream commit 99fdf6b1cadf41bb253408589788f025027274f3 ]

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>
---
 drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c
@@ -2785,8 +2785,12 @@ int hns3_uninit_all_ring(struct hns3_nic
 			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;
 }


Patches currently in stable-queue which might be from lipeng321@huawei.com are

queue-4.15/net-hns3-fix-for-getting-auto-negotiation-state-in-hclge_get_autoneg.patch
queue-4.15/net-hns3-free-the-ring_data-structrue-when-change-tqps.patch
queue-4.15/net-hns3-fix-a-loop-index-error-of-tqp-statistics-query.patch
queue-4.15/net-hns3-fix-an-error-macro-definition-of-hns3_tqp_stat.patch
queue-4.15/net-hns3-add-asym-pause-support-to-phy-default-features.patch
queue-4.15/net-hns3-fix-an-error-of-total-drop-packet-statistics.patch
queue-4.15/net-hns3-fix-for-changing-mtu.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-09  9:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-09  9:36 Patch "net: hns3: free the ring_data structrue when change tqps" has been added to the 4.15-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).