aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/sw
diff options
context:
space:
mode:
authorKamal Heib <kamalheib1@gmail.com>2019-09-23 13:41:58 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-10-01 13:06:10 -0300
commitf3fceba5da5e149ecd8e58c1e1c60464629de27b (patch)
tree174172a3479c6946e888c33aa58bd9ae1de51a50 /drivers/infiniband/sw
parentRDMA/bnxt_re: Remove unsupported modify_device callback (diff)
downloadlinux-dev-f3fceba5da5e149ecd8e58c1e1c60464629de27b.tar.xz
linux-dev-f3fceba5da5e149ecd8e58c1e1c60464629de27b.zip
RDMA/rxe: Verify modify_device mask
Verify that the passed mask to rxe_modify_device() is supported. Link: https://lore.kernel.org/r/20190923104158.5331-4-kamalheib1@gmail.com Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r--drivers/infiniband/sw/rxe/rxe_verbs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index 623129f27f5a..fa47bdcc7f54 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -106,6 +106,10 @@ static int rxe_modify_device(struct ib_device *dev,
{
struct rxe_dev *rxe = to_rdev(dev);
+ if (mask & ~(IB_DEVICE_MODIFY_SYS_IMAGE_GUID |
+ IB_DEVICE_MODIFY_NODE_DESC))
+ return -EOPNOTSUPP;
+
if (mask & IB_DEVICE_MODIFY_SYS_IMAGE_GUID)
rxe->attr.sys_image_guid = cpu_to_be64(attr->sys_image_guid);