1 From 1208fd569c07ab84aa5d024abd863267c2953b4a Mon Sep 17 00:00:00 2001
2 From: "J. Bruce Fields" <bfields@redhat.com>
3 Date: Fri, 20 May 2016 17:07:17 -0400
4 Subject: SUNRPC: fix xprt leak on xps allocation failure
6 From: J. Bruce Fields <bfields@redhat.com>
8 commit 1208fd569c07ab84aa5d024abd863267c2953b4a upstream.
10 Callers of rpc_create_xprt expect it to put the xprt on success and
13 Signed-off-by: J. Bruce Fields <bfields@redhat.com>
14 Acked-by: Trond Myklebust <trondmy@primarydata.com>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 net/sunrpc/clnt.c | 5 +++--
19 1 file changed, 3 insertions(+), 2 deletions(-)
21 --- a/net/sunrpc/clnt.c
22 +++ b/net/sunrpc/clnt.c
23 @@ -453,9 +453,10 @@ static struct rpc_clnt *rpc_create_xprt(
24 struct rpc_xprt_switch *xps;
26 xps = xprt_switch_alloc(xprt, GFP_KERNEL);
30 return ERR_PTR(-ENOMEM);
33 clnt = rpc_new_client(args, xps, xprt, NULL);