提交 d2fcea7d 编写于 作者: V Vu Pham 提交者: Roland Dreier

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: NVu Pham <vu@mellanox.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 04699a1f
......@@ -1176,9 +1176,11 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event)
break;
}
target->status = srp_alloc_iu_bufs(target);
if (target->status)
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册