summaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@kernel.org>2007-11-14 17:00:00 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-14 18:45:41 -0800
commitd5cd97872dca9b79c31224ca014bcea7ca01f5f1 (patch)
tree1d2252ebddd62fb8d6669385e58e27b489c30dba /net/sunrpc
parente02f5f52cafbea013817d81f1acc4baf50d6324b (diff)
downloadblackbird-op-linux-d5cd97872dca9b79c31224ca014bcea7ca01f5f1.tar.gz
blackbird-op-linux-d5cd97872dca9b79c31224ca014bcea7ca01f5f1.zip
sunrpc/xprtrdma/transport.c: fix use-after-free
Fix an obvious use-after-free spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Neil Brown <neilb@suse.de> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/transport.c2
1 files changed, 1 insertions, 1 deletions
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);
}
OpenPOWER on IntegriCloud