Commit 85bfd71b authored by Chuck Lever's avatar Chuck Lever Committed by Anna Schumaker

xprtrdma: Fix double-free in rpcrdma_ep_create()

In the error paths, there's no need to call kfree(ep) after calling
rpcrdma_ep_put(ep).

Fixes: e28ce900 ("xprtrdma: kmalloc rpcrdma_ep separate from rpcrdma_xprt")
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 11ba4688
...@@ -406,8 +406,8 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt) ...@@ -406,8 +406,8 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)
id = rpcrdma_create_id(r_xprt, ep); id = rpcrdma_create_id(r_xprt, ep);
if (IS_ERR(id)) { if (IS_ERR(id)) {
rc = PTR_ERR(id); kfree(ep);
goto out_free; return PTR_ERR(id);
} }
__module_get(THIS_MODULE); __module_get(THIS_MODULE);
device = id->device; device = id->device;
...@@ -506,9 +506,6 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt) ...@@ -506,9 +506,6 @@ static int rpcrdma_ep_create(struct rpcrdma_xprt *r_xprt)
out_destroy: out_destroy:
rpcrdma_ep_put(ep); rpcrdma_ep_put(ep);
rdma_destroy_id(id); rdma_destroy_id(id);
out_free:
kfree(ep);
r_xprt->rx_ep = NULL;
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment