Skip to content

Commit

Permalink
sunrpc/xprtrdma/transport.c: fix use-after-free
Browse files Browse the repository at this point in the history
Fix an obvious use-after-free spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: "J. Bruce Fields" <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: "David S. Miller" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
AdrianBunk authored and Linus Torvalds committed Nov 15, 2007
1 parent e02f5f5 commit d5cd978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit d5cd978

Please sign in to comment.