/* Align the MR to a 4K page size to match the block virt boundary */
nr = ib_map_mr_sg(req->mr, req->sglist, count, NULL, SZ_4K);
- if (unlikely(nr < req->sg_cnt)) {
- if (nr < 0)
- return nr;
+ if (nr < 0)
+ return nr;
+ if (unlikely(nr < req->sg_cnt))
return -EINVAL;
- }
ib_update_fast_reg_key(req->mr, ib_inc_rkey(req->mr->rkey));
return nr;