mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 10:01:43 +00:00
RDMA/rtrs-srv: Fix missing wr_cqe
We had a few places wr_cqe is not set, which could lead to NULL pointer
deref or GPF in error case.
Fixes: 9cb8374804
("RDMA/rtrs: server: main functionality")
Link: https://lore.kernel.org/r/20201217141915.56989-14-jinpu.wang@cloud.ionos.com
Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Reviewed-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
7a8732a6f9
commit
8537f2de65
@ -267,6 +267,7 @@ static int rdma_write_sg(struct rtrs_srv_op *id)
|
||||
WARN_ON_ONCE(rkey != wr->rkey);
|
||||
|
||||
wr->wr.opcode = IB_WR_RDMA_WRITE;
|
||||
wr->wr.wr_cqe = &io_comp_cqe;
|
||||
wr->wr.ex.imm_data = 0;
|
||||
wr->wr.send_flags = 0;
|
||||
|
||||
@ -294,6 +295,7 @@ static int rdma_write_sg(struct rtrs_srv_op *id)
|
||||
inv_wr.sg_list = NULL;
|
||||
inv_wr.num_sge = 0;
|
||||
inv_wr.opcode = IB_WR_SEND_WITH_INV;
|
||||
inv_wr.wr_cqe = &io_comp_cqe;
|
||||
inv_wr.send_flags = 0;
|
||||
inv_wr.ex.invalidate_rkey = rkey;
|
||||
}
|
||||
@ -304,6 +306,7 @@ static int rdma_write_sg(struct rtrs_srv_op *id)
|
||||
|
||||
srv_mr = &sess->mrs[id->msg_id];
|
||||
rwr.wr.opcode = IB_WR_REG_MR;
|
||||
rwr.wr.wr_cqe = &local_reg_cqe;
|
||||
rwr.wr.num_sge = 0;
|
||||
rwr.mr = srv_mr->mr;
|
||||
rwr.wr.send_flags = 0;
|
||||
@ -379,6 +382,7 @@ static int send_io_resp_imm(struct rtrs_srv_con *con, struct rtrs_srv_op *id,
|
||||
|
||||
if (need_inval) {
|
||||
if (likely(sg_cnt)) {
|
||||
inv_wr.wr_cqe = &io_comp_cqe;
|
||||
inv_wr.sg_list = NULL;
|
||||
inv_wr.num_sge = 0;
|
||||
inv_wr.opcode = IB_WR_SEND_WITH_INV;
|
||||
@ -421,6 +425,7 @@ static int send_io_resp_imm(struct rtrs_srv_con *con, struct rtrs_srv_op *id,
|
||||
srv_mr = &sess->mrs[id->msg_id];
|
||||
rwr.wr.next = &imm_wr;
|
||||
rwr.wr.opcode = IB_WR_REG_MR;
|
||||
rwr.wr.wr_cqe = &local_reg_cqe;
|
||||
rwr.wr.num_sge = 0;
|
||||
rwr.wr.send_flags = 0;
|
||||
rwr.mr = srv_mr->mr;
|
||||
|
Loading…
Reference in New Issue
Block a user