Blame SOURCES/0001-libqedr-Fix-reported-error-code-from-create_cq.patch

fa196d
From da998d0d6eb8ca6fbe7848cf4c0808797ab9c882 Mon Sep 17 00:00:00 2001
fa196d
From: Kamal Heib <kamalheib1@gmail.com>
fa196d
Date: Wed, 23 Dec 2020 18:49:52 +0200
fa196d
Subject: [PATCH] libqedr: Fix reported error code from create_cq
fa196d
fa196d
[ Upstream commit e8b5a1d673f1eb2d93fb9fe09759fa03a6cf8aad ]
fa196d
fa196d
Report EINVAL when trying to call qelr_create_cq() with number of CQEs
fa196d
bigger than the supported max_cqes, also fix the printed range.
fa196d
fa196d
Fixes: c0965e4fe6fe ("libqedr (qelr) verbs")
fa196d
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
fa196d
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
fa196d
---
fa196d
 providers/qedr/qelr_verbs.c | 3 ++-
fa196d
 1 file changed, 2 insertions(+), 1 deletion(-)
fa196d
fa196d
diff --git a/providers/qedr/qelr_verbs.c b/providers/qedr/qelr_verbs.c
fa196d
index e75d508f100b..631c9f844a95 100644
fa196d
--- a/providers/qedr/qelr_verbs.c
fa196d
+++ b/providers/qedr/qelr_verbs.c
fa196d
@@ -231,7 +231,8 @@ struct ibv_cq *qelr_create_cq(struct ibv_context *context, int cqe,
fa196d
 	if (!cqe || cqe > cxt->max_cqes) {
fa196d
 		DP_ERR(cxt->dbg_fp,
fa196d
 		       "create cq: failed. attempted to allocate %d cqes but valid range is 1...%d\n",
fa196d
-		       cqe, cqe > cxt->max_cqes);
fa196d
+		       cqe, cxt->max_cqes);
fa196d
+		errno = EINVAL;
fa196d
 		return NULL;
fa196d
 	}
fa196d
 
fa196d
-- 
fa196d
2.25.4
fa196d