Skip to content

Commit 686d348

Browse files
zhijianli88rleon
authored andcommitted
RDMA/rxe: Remove unnecessary mr testing
Before the testing, we already passed it to rxe_mr_copy() where mr could be dereferenced. so this checking is not needed. The only way that mr is NULL is when it reaches below line 780 with 'qp->resp.mr = NULL', which is not possible in Bob's explanation[1]. 778 if (res->state == rdatm_res_state_new) { 779 if (!res->replay) { 780 mr = qp->resp.mr; 781 qp->resp.mr = NULL; 782 } else { [1] https://lore.kernel.org/lkml/[email protected]/ Link: https://lore.kernel.org/r/[email protected] CC: Bob Pearson <[email protected]> Signed-off-by: Li Zhijian <[email protected]> Reviewed-by: Bob Pearson <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 5ac814e commit 686d348

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/infiniband/sw/rxe/rxe_resp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,7 @@ static enum resp_states read_reply(struct rxe_qp *qp,
811811

812812
err = rxe_mr_copy(mr, res->read.va, payload_addr(&ack_pkt),
813813
payload, RXE_FROM_MR_OBJ);
814-
if (mr)
815-
rxe_put(mr);
814+
rxe_put(mr);
816815
if (err) {
817816
kfree_skb(skb);
818817
return RESPST_ERR_RKEY_VIOLATION;

0 commit comments

Comments
 (0)