On 02/02/2023 12:42, Bob Pearson wrote: > +/* resolve the packet rkey to qp->resp.mr or set qp->resp.mr to NULL > + * if an invalid rkey is received or the rdma length is zero. For middle > + * or last packets use the stored value of mr. > + */ > static enum resp_states check_rkey(struct rxe_qp *qp, > struct rxe_pkt_info *pkt) > { > @@ -473,10 +487,12 @@ static enum resp_states check_rkey(struct rxe_qp *qp, > return RESPST_EXECUTE; > } > > - /* A zero-byte op is not required to set an addr or rkey. See C9-88 */ > + /* A zero-byte read or write op is not required to > + * set an addr or rkey. See C9-88 > + */ > if ((pkt->mask & RXE_READ_OR_WRITE_MASK) && > - (pkt->mask & RXE_RETH_MASK) && > - reth_len(pkt) == 0) { > + (pkt->mask & RXE_RETH_MASK) && reth_len(pkt) == 0) { > + qp->resp.mr = NULL; You are making sure 'qp->resp.mr = NULL', but I doubt the previous qp->resp.mr will leak after this assignment when its value is not NULL. Thanks Zhijian > return RESPST_EXECUTE; > } > > @@ -555,6 +571,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp, > return RESPST_EXECUTE; > > err: > + qp->resp.mr = NULL; > if (mr)