aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
authorParav Pandit <parav@mellanox.com>2019-05-01 08:46:55 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-05-03 10:41:23 -0300
commiteb15c78b05bd9fbac45ee5b56aaf29b2570b5238 (patch)
tree5e22616df2a1a3d2601516e4ce7928b608270914 /drivers/infiniband/core/device.c
parentIB/core: Set qp->real_qp before it may be accessed (diff)
downloadlinux-dev-eb15c78b05bd9fbac45ee5b56aaf29b2570b5238.tar.xz
linux-dev-eb15c78b05bd9fbac45ee5b56aaf29b2570b5238.zip
RDMA/core: Do not invoke init_port on compat devices
The driver interface cannot manipulate the sysfs of the compat device, only of the full device so we must avoid calling the driver sysfs APIs on compat devices. This prevents an oops: Call Trace: dump_stack+0x5a/0x73 kobject_init+0x74/0x80 kobject_init_and_add+0x35/0xb0 hfi1_create_port_files+0x6e/0x3c0 [hfi1] ib_setup_port_attrs+0x43b/0x560 [ib_core] add_one_compat_dev+0x16a/0x230 [ib_core] rdma_dev_init_net+0x110/0x160 [ib_core] ops_init+0x38/0xf0 setup_net+0xcf/0x1e0 copy_net_ns+0xb7/0x130 create_new_namespaces+0x11a/0x1b0 unshare_nsproxy_namespaces+0x55/0xa0 ksys_unshare+0x1a7/0x340 __x64_sys_unshare+0xe/0x20 do_syscall_64+0x5b/0x180 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: 5417783eabb2 ("RDMA/core: Support core port attributes in non init_net") Reported-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Tested-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Parav Pandit <parav@mellanox.com> 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/device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 76088655f06e..2123cc693a29 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -870,7 +870,7 @@ static int add_one_compat_dev(struct ib_device *device,
ret = device_add(&cdev->dev);
if (ret)
goto add_err;
- ret = ib_setup_port_attrs(cdev, false);
+ ret = ib_setup_port_attrs(cdev);
if (ret)
goto port_err;