From: Adrian Bunk Date: Thu, 15 Nov 2007 01:00:00 +0000 (-0800) Subject: sunrpc/xprtrdma/transport.c: fix use-after-free X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d5cd97872dca9b79c31224ca014bcea7ca01f5f1;p=openwrt%2Fstaging%2Fblogic.git sunrpc/xprtrdma/transport.c: fix use-after-free Fix an obvious use-after-free spotted by the Coverity checker. Signed-off-by: Adrian Bunk Cc: Trond Myklebust Cc: "J. Bruce Fields" Cc: Neil Brown Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index dc55cc974c90..1afeb3eb8e4c 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c @@ -320,9 +320,9 @@ xprt_setup_rdma(struct xprt_create *args) xprt->slot = kcalloc(xprt->max_reqs, sizeof(struct rpc_rqst), GFP_KERNEL); if (xprt->slot == NULL) { - kfree(xprt); dprintk("RPC: %s: couldn't allocate %d slots\n", __func__, xprt->max_reqs); + kfree(xprt); return ERR_PTR(-ENOMEM); }