mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-14 04:41:26 +00:00
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>
This commit is contained in:
parent
e02f5f52ca
commit
d5cd97872d
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user