net :sunrpc :clnt :Fix xps refcount imbalance on the error path
Subsystems (3)
PATCH 1/1 net :sunrpc :clnt :Fix xps refcount imbalance on the error path
rpc_clnt_add_xprt take a reference to struct rpc_xprt_switch, but forget to release it before return, may lead to a memory leak.
Signed-off-by Lin Yi <[email protected]>
--- net/sunrpc/clnt.c | 1 + 1 file changed, 1 insertion(+)
net/sunrpc/clnt.c +1 -0
@@ -2805,6 +2805,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt, xprt =xprt_iter_xprt (&clnt->cl_xpi);if (xps ==NULL || xprt ==NULL ) {rcu_read_unlock (); +xprt_switch_put (xps);return -EAGAIN ; } resvport = xprt->resvport;
Signature · 1 line
1.9.1