[PATCH rdma-core 1/3] libqedr: Check queue mapping return value correctly

Ram Amrani
2017-02-16T05:56:09Z

When mapping CQ/RQ/SQ check the mmap return value.

Signed-off-by: Ram Amrani <Ram.Amrani-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Ariel Elior <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
---
providers/qedr/qelr_chain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/providers/qedr/qelr_chain.c b/providers/qedr/qelr_chain.c
index edc72f4..d9ccc0b 100644
--- a/providers/qedr/qelr_chain.c
+++ b/providers/qedr/qelr_chain.c
@@ -76,7 +76,7 @@ int qelr_chain_alloc(struct qelr_chain *chain, int chain_size, int page_size,
addr = mmap(NULL, a_chain_size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, QELR_ANON_FD,
QELR_ANON_OFFSET);
- if (chain->first_addr == MAP_FAILED)
+ if (addr == MAP_FAILED)
return errno;

ret = ibv_dontfork_range(addr, a_chain_size);