Skip to contentSkip to conversation

Patch "net: hns3: free the ring_data structrue when change tqps" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 1 message Apr 9, 2018

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Apr 9 10:16:32 CEST 2018

From: Peng Li <[email protected]>
Date: Fri, 22 Dec 2017 12:21:43 +0800
Subject: net: hns3: free the ring_data structrue when change tqps

From: Peng Li <[email protected]>

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

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