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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.14-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.14 subdirectory.

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


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

From: Peng Li <lipeng321@xxxxxxxxxx>


[ 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@xxxxxxxxxx>
Signed-off-by: Mingguang Qu <qumingguang@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 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
@@ -2687,8 +2687,12 @@ static int hns3_uninit_all_ring(struct h
 			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@xxxxxxxxxx are

queue-4.14/net-hns3-fix-for-getting-auto-negotiation-state-in-hclge_get_autoneg.patch
queue-4.14/net-hns3-free-the-ring_data-structrue-when-change-tqps.patch
queue-4.14/net-hns3-fix-a-loop-index-error-of-tqp-statistics-query.patch
queue-4.14/net-hns3-fix-an-error-macro-definition-of-hns3_tqp_stat.patch
queue-4.14/net-hns3-fix-an-error-of-total-drop-packet-statistics.patch
queue-4.14/net-hns3-fix-for-changing-mtu.patch



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]