From 8c0383a31be17173c12cc8b4a3a91ffe4951d456 Mon Sep 17 00:00:00 2001 From: Sai Sunku Date: Mon, 25 Sep 2023 15:23:36 +0000 Subject: [PATCH] prov/efa: Fix coverity warning in efa_mr_reg_impl If mr_attr->mr_iov is NULL, don't dereference it Cherry-pick of 09ab9e5 and 31ea3ab Signed-off-by: Sai Sunku --- prov/efa/src/efa_mr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prov/efa/src/efa_mr.c b/prov/efa/src/efa_mr.c index bdb89c9b031..8dfc6ce2644 100644 --- a/prov/efa/src/efa_mr.c +++ b/prov/efa/src/efa_mr.c @@ -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; }