Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2fcea7d authored by Vu Pham's avatar Vu Pham Committed by Roland Dreier
Browse files

IB/srp: Fix memory leak on reconnect



SRP reallocates the IU buffers for tx_ring and rx_ring without freeing
the old buffers when it reconnects to a target.  Fix this by keeping
the old IU buffers around.

Signed-off-by: default avatarVu Pham <vu@mellanox.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 04699a1f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1176,9 +1176,11 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
			break;
		}

		if (!target->rx_ring[0]) {
			target->status = srp_alloc_iu_bufs(target);
			if (target->status)
				break;
		}

		qp_attr = kmalloc(sizeof *qp_attr, GFP_KERNEL);
		if (!qp_attr) {