Blame SOURCES/0006-verbs-Set-missing-errno-in-ibv_cmd_reg_mr.patch

764884
From 5639fce1322dd8ae1398f8a7f530197484fc1f9e Mon Sep 17 00:00:00 2001
764884
From: Shay Drory <shayd@mellanox.com>
764884
Date: Mon, 7 Oct 2019 12:09:05 +0300
764884
Subject: [PATCH rdma-core 06/13] verbs: Set missing errno in ibv_cmd_reg_mr
764884
764884
[ Upstream commit f9e127a4bffa09ee72fc0ce92228296a4d1c1588 ]
764884
764884
Set missing errno in ibv_cmd_reg_mr() when implicit MR is used.
764884
764884
Fixes: d4021e743fda7 ("verbs: Fix implicit ODP MR support for 32 bit
764884
systems")
764884
Signed-off-by: Shay Drory <shayd@mellanox.com>
764884
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
764884
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
764884
---
764884
 libibverbs/cmd.c | 4 +++-
764884
 1 file changed, 3 insertions(+), 1 deletion(-)
764884
764884
diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
764884
index 3936e69b..26eaa479 100644
764884
--- a/libibverbs/cmd.c
764884
+++ b/libibverbs/cmd.c
764884
@@ -340,8 +340,10 @@ int ibv_cmd_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
764884
 	 * In that case set the value in the command to what kernel expects.
764884
 	 */
764884
 	if (access & IBV_ACCESS_ON_DEMAND) {
764884
-		if (length == SIZE_MAX && addr)
764884
+		if (length == SIZE_MAX && addr) {
764884
+			errno = EINVAL;
764884
 			return EINVAL;
764884
+		}
764884
 		if (length == SIZE_MAX)
764884
 			cmd->length = UINT64_MAX;
764884
 	}
764884
-- 
764884
2.20.1
764884