svn commit: r331010 - projects/bsd_rdma_4_9_stable_11/sys/ofed/include/rdma

Hans Petter Selasky hselasky at FreeBSD.org
Thu Mar 15 17:12:10 UTC 2018


Author: hselasky
Date: Thu Mar 15 17:12:09 2018
New Revision: 331010
URL: https://svnweb.freebsd.org/changeset/base/331010

Log:
  Add missing ib_check_mr_access() call to ib_get_dma_mr() in ibcore compat layer.
  
  Sponsored by:	Mellanox Technologies

Modified:
  projects/bsd_rdma_4_9_stable_11/sys/ofed/include/rdma/ib_verbs_compat.h

Modified: projects/bsd_rdma_4_9_stable_11/sys/ofed/include/rdma/ib_verbs_compat.h
==============================================================================
--- projects/bsd_rdma_4_9_stable_11/sys/ofed/include/rdma/ib_verbs_compat.h	Thu Mar 15 17:10:56 2018	(r331009)
+++ projects/bsd_rdma_4_9_stable_11/sys/ofed/include/rdma/ib_verbs_compat.h	Thu Mar 15 17:12:09 2018	(r331010)
@@ -365,6 +365,14 @@ static inline struct ib_mr *
 ib_get_dma_mr(struct ib_pd *pd, int mr_access_flags)
 {
 	struct ib_mr *mr;
+	int err;
+
+	err = ib_check_mr_access(mr_access_flags);
+	if (err)
+		return ERR_PTR(err);
+
+	if (!pd->device->get_dma_mr)
+		return ERR_PTR(-ENOSYS);
 
 	mr = pd->device->get_dma_mr(pd, mr_access_flags);
 	if (IS_ERR(mr))


More information about the svn-src-projects mailing list