Skip to content

Commit

Permalink
prov/efa: Fix coverity warning in efa_mr_reg_impl
Browse files Browse the repository at this point in the history
If mr_attr->mr_iov is NULL, don't dereference it

Cherry-pick of 09ab9e5 and 31ea3ab

Signed-off-by: Sai Sunku <sunkusa@amazon.com>
  • Loading branch information
sunkuamzn authored and a-szegel committed Oct 10, 2023
1 parent 0e2669e commit 8c0383a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prov/efa/src/efa_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,8 @@ static int efa_mr_reg_impl(struct efa_mr *efa_mr, uint64_t flags, const void *at
ret,
fi_strerror(-ret),
efa_mr->mr_fid.key,
mr_attr.mr_iov->iov_base,
mr_attr.mr_iov->iov_len);
mr_attr.mr_iov ? mr_attr.mr_iov->iov_base : NULL,
mr_attr.mr_iov ? mr_attr.mr_iov->iov_len : 0);
efa_mr_dereg_impl(efa_mr);
return ret;
}
Expand Down

0 comments on commit 8c0383a

Please sign in to comment.