[rdma-core] librdmacm: Make return value from ucma_init consist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When check_abi_version fails we must be consist with rest of exit flows
of the function and return -1 and set errno with the actual error code.

Signed-off-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx>
---
 librdmacm/cma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/librdmacm/cma.c b/librdmacm/cma.c
index 7aaf45f2..4898c348 100644
--- a/librdmacm/cma.c
+++ b/librdmacm/cma.c
@@ -202,8 +202,10 @@ int ucma_init(void)
 
 	fastlock_init(&idm_lock);
 	ret = check_abi_version();
-	if (ret)
+	if (ret) {
+		ret = ERR(EPERM);
 		goto err1;
+	}
 
 	dev_list = ibv_get_device_list(&dev_cnt);
 	if (!dev_list) {
-- 
2.13.6

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux