IB/rxe: Fix reference leaks in memory key invalidation code
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 10 Jan 2017 19:15:52 +0000 (11:15 -0800)
committerDoug Ledford <dledford@redhat.com>
Tue, 10 Jan 2017 21:52:47 +0000 (16:52 -0500)
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Andrew Boyer <andrew.boyer@dell.com>
Cc: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_req.c
drivers/infiniband/sw/rxe/rxe_resp.c

index d62be4828899cf94a9a205f275ad25d6240145f3..512e74326b1632bbfa081b9db8fa8b23a40a5e57 100644 (file)
@@ -635,6 +635,7 @@ next_wqe:
                                goto exit;
                        }
                        rmr->state = RXE_MEM_STATE_FREE;
+                       rxe_drop_ref(rmr);
                        wqe->state = wqe_state_done;
                        wqe->status = IB_WC_SUCCESS;
                } else if (wqe->wr.opcode == IB_WR_REG_MR) {
index 60d78f45aa04158ed52b9f9c35e945b77034552b..05f374986cea1fe6c4f4fb17b7628f9ec48a0b98 100644 (file)
@@ -907,6 +907,7 @@ static enum resp_states do_complete(struct rxe_qp *qp,
                                        return RESPST_ERROR;
                                }
                                rmr->state = RXE_MEM_STATE_FREE;
+                               rxe_drop_ref(rmr);
                        }
 
                        wc->qp                  = &qp->ibqp;