Browse Source

IB/rxe: Fix reference leaks in memory key invalidation code

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>
Bart Van Assche 8 years ago
parent
commit
ab17654476
2 changed files with 2 additions and 0 deletions
  1. 1 0
      drivers/infiniband/sw/rxe/rxe_req.c
  2. 1 0
      drivers/infiniband/sw/rxe/rxe_resp.c

+ 1 - 0
drivers/infiniband/sw/rxe/rxe_req.c

@@ -635,6 +635,7 @@ next_wqe:
 				goto exit;
 				goto exit;
 			}
 			}
 			rmr->state = RXE_MEM_STATE_FREE;
 			rmr->state = RXE_MEM_STATE_FREE;
+			rxe_drop_ref(rmr);
 			wqe->state = wqe_state_done;
 			wqe->state = wqe_state_done;
 			wqe->status = IB_WC_SUCCESS;
 			wqe->status = IB_WC_SUCCESS;
 		} else if (wqe->wr.opcode == IB_WR_REG_MR) {
 		} else if (wqe->wr.opcode == IB_WR_REG_MR) {

+ 1 - 0
drivers/infiniband/sw/rxe/rxe_resp.c

@@ -907,6 +907,7 @@ static enum resp_states do_complete(struct rxe_qp *qp,
 					return RESPST_ERROR;
 					return RESPST_ERROR;
 				}
 				}
 				rmr->state = RXE_MEM_STATE_FREE;
 				rmr->state = RXE_MEM_STATE_FREE;
+				rxe_drop_ref(rmr);
 			}
 			}
 
 
 			wc->qp			= &qp->ibqp;
 			wc->qp			= &qp->ibqp;