diff mbox

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

Message ID 20171107084321.6396-1-yuval.shaia@oracle.com (mailing list archive)
State Accepted
Headers show

Commit Message

Yuval Shaia Nov. 7, 2017, 8:43 a.m. UTC
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@oracle.com>
---
 librdmacm/cma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Leon Romanovsky Nov. 8, 2017, 2:49 p.m. UTC | #1
On Tue, Nov 07, 2017 at 10:43:21AM +0200, Yuval Shaia wrote:
> 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@oracle.com>
> ---
>  librdmacm/cma.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>

Thanks, applied.
diff mbox

Patch

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) {