[disco:linux,1/1] Revert "RDMA/cm: Fix memory leak in cm_add/remove_one"
diff mbox series

Message ID 20200114225006.5433-2-marcelo.cerri@canonical.com
State New
Headers show
Series
  • LP:#1859582 - System hang with kernel traces while entering reboot process on a Disco ARM64 moonshot node
Related show

Commit Message

Marcelo Henrique Cerri Jan. 14, 2020, 10:50 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1859582

This reverts commit f56d075cabc10ddbcfc1bf2c8291c46995176a86.

cm_remove_port_fs() in 5.0 doesn't behave as in upstream and the
additional kfree(port) is not necessary.

Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
---
 drivers/infiniband/core/cm.c | 3 ---
 1 file changed, 3 deletions(-)

Patch
diff mbox series

diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 03cc9b0a235c..37980c7564c0 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -4431,7 +4431,6 @@  static void cm_add_one(struct ib_device *ib_device)
 error1:
 	port_modify.set_port_cap_mask = 0;
 	port_modify.clr_port_cap_mask = IB_PORT_CM_SUP;
-	kfree(port);
 	while (--i) {
 		if (!rdma_cap_ib_cm(ib_device, i))
 			continue;
@@ -4440,7 +4439,6 @@  static void cm_add_one(struct ib_device *ib_device)
 		ib_modify_port(ib_device, port->port_num, 0, &port_modify);
 		ib_unregister_mad_agent(port->mad_agent);
 		cm_remove_port_fs(port);
-		kfree(port);
 	}
 free:
 	device_unregister(cm_dev->device);
@@ -4495,7 +4493,6 @@  static void cm_remove_one(struct ib_device *ib_device, void *client_data)
 		spin_unlock_irq(&cm.state_lock);
 		ib_unregister_mad_agent(cur_mad_agent);
 		cm_remove_port_fs(port);
-		kfree(port);
 	}
 
 	device_unregister(cm_dev->device);