Skip to content

Commit

Permalink
Merge tag 'nfs-rdma-for-4.3-2' of git://git.linux-nfs.org/projects/an…
Browse files Browse the repository at this point in the history
…na/nfs-rdma

NFS: NFSoRDMA bugfix

Fixes a use-after-free bug.

Signed-off-by: Anna Schumaker <Anna.Schumaker@netapp.com>
  • Loading branch information
Trond Myklebust committed Oct 2, 2015
2 parents 5e99b53 + 72c0217 commit 8dbb095
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ xprt_rdma_destroy(struct rpc_xprt *xprt)

xprt_clear_connected(xprt);

rpcrdma_buffer_destroy(&r_xprt->rx_buf);
rpcrdma_ep_destroy(&r_xprt->rx_ep, &r_xprt->rx_ia);
rpcrdma_buffer_destroy(&r_xprt->rx_buf);
rpcrdma_ia_close(&r_xprt->rx_ia);

xprt_rdma_free_addresses(xprt);
Expand Down
9 changes: 6 additions & 3 deletions net/sunrpc/xprtrdma/verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,19 +755,22 @@ rpcrdma_ep_destroy(struct rpcrdma_ep *ep, struct rpcrdma_ia *ia)

cancel_delayed_work_sync(&ep->rep_connect_worker);

if (ia->ri_id->qp) {
if (ia->ri_id->qp)
rpcrdma_ep_disconnect(ep, ia);

rpcrdma_clean_cq(ep->rep_attr.recv_cq);
rpcrdma_clean_cq(ep->rep_attr.send_cq);

if (ia->ri_id->qp) {
rdma_destroy_qp(ia->ri_id);
ia->ri_id->qp = NULL;
}

rpcrdma_clean_cq(ep->rep_attr.recv_cq);
rc = ib_destroy_cq(ep->rep_attr.recv_cq);
if (rc)
dprintk("RPC: %s: ib_destroy_cq returned %i\n",
__func__, rc);

rpcrdma_clean_cq(ep->rep_attr.send_cq);
rc = ib_destroy_cq(ep->rep_attr.send_cq);
if (rc)
dprintk("RPC: %s: ib_destroy_cq returned %i\n",
Expand Down

0 comments on commit 8dbb095

Please sign in to comment.