[lvc-project] [PATCH] RDMA/erdma: Drop redundant NULL check on error path
Ваторопин Андрей
a.vatoropin at crpt.ru
Thu Jan 30 10:55:38 MSK 2025
From: Andrey Vatoropin <a.vatoropin at crpt.ru>
Static analysis shows that on the error handling path in the
get_mtt_entries() function, the mem->umem pointer cannot be NULL,
because it is pointer to struct.
Remove the extra NULL check. It is meaningless and harms the readability
of the code.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Vatoropin <a.vatoropin at crpt.ru>
---
drivers/infiniband/hw/erdma/erdma_verbs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/hw/erdma/erdma_verbs.c b/drivers/infiniband/hw/erdma/erdma_verbs.c
index 51d619edb6c5..fe4b79f15cf6 100644
--- a/drivers/infiniband/hw/erdma/erdma_verbs.c
+++ b/drivers/infiniband/hw/erdma/erdma_verbs.c
@@ -794,10 +794,8 @@ static int get_mtt_entries(struct erdma_dev *dev, struct erdma_mem *mem,
return 0;
error_ret:
- if (mem->umem) {
- ib_umem_release(mem->umem);
- mem->umem = NULL;
- }
+ ib_umem_release(mem->umem);
+ mem->umem = NULL;
return ret;
}
--
2.43.0
More information about the lvc-project
mailing list