Commit 30a5ec98 authored by Sean Hefty's avatar Sean Hefty Committed by Roland Dreier

RDMA/ucma: Fix struct ucma_event leak when backlog is full

We discard new connection requests while the listen backlog is full,
but leak a struct ucma_event in the process.  Free the structure in
this case.
Signed-off-by: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 881a045f
...@@ -209,6 +209,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, ...@@ -209,6 +209,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id,
if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) {
if (!ctx->backlog) { if (!ctx->backlog) {
ret = -EDQUOT; ret = -EDQUOT;
kfree(uevent);
goto out; goto out;
} }
ctx->backlog--; ctx->backlog--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment