aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/core_priv.h
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@mellanox.com>2018-02-14 14:38:43 +0200
committerJason Gunthorpe <jgg@mellanox.com>2018-02-16 09:18:55 -0700
commit2188558621ed475cef55fa94ce535499452f0091 (patch)
tree7e8e94051735e7515173c2f208ef737010a7c0cb /drivers/infiniband/core/core_priv.h
parentRDMA/vmw_pvrdma: Fix usage of user response structures in ABI file (diff)
downloadlinux-dev-2188558621ed475cef55fa94ce535499452f0091.tar.xz
linux-dev-2188558621ed475cef55fa94ce535499452f0091.zip
RDMA/verbs: Check existence of function prior to accessing it
Update all the flows to ensure that function pointer exists prior to accessing it. This is much safer than checking the uverbs_ex_mask variable, especially since we know that test isn't working properly and will be removed in -next. This prevents a user triggereable oops. Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to '')
-rw-r--r--drivers/infiniband/core/core_priv.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h
index c4560d84dfae..c91f9a80b831 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -309,6 +309,9 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev,
{
struct ib_qp *qp;
+ if (!dev->create_qp)
+ return ERR_PTR(-EOPNOTSUPP);
+
qp = dev->create_qp(pd, attr, udata);
if (IS_ERR(qp))
return qp;