diff mbox series

[rdma-core,5/5] libhns: Bugfix for useing buffer length

Message ID 1550307813-151285-6-git-send-email-oulijun@huawei.com (mailing list archive)
State Superseded
Headers show
Series Misc updates for libhns | expand

Commit Message

Lijun Ou Feb. 16, 2019, 9:03 a.m. UTC
We should use the length of buffer after aligned according the
input size for ibv_dontfork_range function.

Fix: c24583975044("libhns: Add verbs of qp support")

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 providers/hns/hns_roce_u_buf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/providers/hns/hns_roce_u_buf.c b/providers/hns/hns_roce_u_buf.c
index f92ea65..27ed90c 100644
--- a/providers/hns/hns_roce_u_buf.c
+++ b/providers/hns/hns_roce_u_buf.c
@@ -46,7 +46,7 @@  int hns_roce_alloc_buf(struct hns_roce_buf *buf, unsigned int size,
 	if (buf->buf == MAP_FAILED)
 		return errno;
 
-	ret = ibv_dontfork_range(buf->buf, size);
+	ret = ibv_dontfork_range(buf->buf, buf->length);
 	if (ret)
 		munmap(buf->buf, buf->length);