Skip to contentSkip to conversation

sunrpc/xprtrdma/transport.c: fix use-after-free

PATCH New Adrian Bunk 1 participant 1 message Oct 18, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunrpc/xprtrdma/transport.c: fix use-after-free

This patch fixes an obvious use-after-free spotted by the Coverity checker.

---
9bb1151172d05c2ffdb09302eb82ca6e1edae47d

net/sunrpc/xprtrdma/transport.c +1 -1
index dc55cc9..1afeb3e 100644
@@ -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);
 	}