* [2.6 patch] sunrpc/xprtrdma/transport.c: fix use-after-free
@ 2007-10-18 10:53 Adrian Bunk
0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2007-10-18 10:53 UTC (permalink / raw)
To: Tom Talpey, Trond Myklebust; +Cc: linux-kernel
This patch fixes an obvious use-after-free spotted by the Coverity
checker.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
9bb1151172d05c2ffdb09302eb82ca6e1edae47d
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index dc55cc9..1afeb3e 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);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-10-18 10:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-18 10:53 [2.6 patch] sunrpc/xprtrdma/transport.c: fix use-after-free Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox