Message ID | 1587361519-83687-1-git-send-email-xiyuyang19@fudan.edu.cn |
---|---|
State | New |
Headers | show |
Series | SUNRPC: Fix refcnt leak in rpc_clnt_test_and_add_xprt | expand |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 7324b21f923e..f86d9ae2167f 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -2803,8 +2803,10 @@ int rpc_clnt_test_and_add_xprt(struct rpc_clnt *clnt, task = rpc_call_null_helper(clnt, xprt, NULL, RPC_TASK_SOFT|RPC_TASK_SOFTCONN|RPC_TASK_ASYNC|RPC_TASK_NULLCREDS, &rpc_cb_add_xprt_call_ops, data); - if (IS_ERR(task)) + if (IS_ERR(task)) { + rpc_cb_add_xprt_release(data); return PTR_ERR(task); + } rpc_put_task(task); success: return 1;