From: Hangyu Hua Date: Tue, 14 Dec 2021 10:46:59 +0000 (+0800) Subject: rds: memory leak in __rds_conn_create() X-Git-Tag: baikal/mips/sdk6.1~6857^2~18 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=85f55cacb78ac7ba2572adc53a7aadd86d971b7e;p=kernel.git rds: memory leak in __rds_conn_create() __rds_conn_create() did not release conn->c_path when loop_trans != 0 and trans->t_prefer_loopback != 0 and is_outgoing == 0. Fixes: 4fae91d8f412 ("RDS tcp loopback connection can hang") Signed-off-by: Hangyu Hua Reviewed-by: Sharath Srinivasan Signed-off-by: David S. Miller --- diff --git a/net/rds/connection.c b/net/rds/connection.c index a3bc4b54d4910..b4cc699c5fad3 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -253,6 +253,7 @@ static struct rds_connection *__rds_conn_create(struct net *net, * should end up here, but if it * does, reset/destroy the connection. */ + kfree(conn->c_path); kmem_cache_free(rds_conn_slab, conn); conn = ERR_PTR(-EOPNOTSUPP); goto out;