From: Sean Hefty Date: Thu, 14 Dec 2006 19:22:19 +0000 (-0800) Subject: RDMA/ucma: Fix struct ucma_event leak when backlog is full X-Git-Tag: firefly_0821_release~31569^2~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=30a5ec982e4cfa955f93c454debaefc4d61d2da6;p=firefly-linux-kernel-4.4.55.git 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: Sean Hefty Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 81a5cdc5733a..9f30f9bffc61 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -209,6 +209,7 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { if (!ctx->backlog) { ret = -EDQUOT; + kfree(uevent); goto out; } ctx->backlog--;